0

I'm working on Background Task using this link it's working in android when app in background state and terminate state but not in iOS. Right now it's working only when user open the application.

But in my scenario after 5mins user will use the app or not, directly call Logout method and delete the data in both the states(Background&Terminate).

nandu kathmandi
  • 33
  • 1
  • 12
  • 1
    You could set a timer and use MessagingCenter to send notification (logout and delete data) . – Lucas Zhang Oct 07 '20 at 13:14
  • I used time and messagingCenter it's working only in android and it's working only when I'm opening the application. But I want to delete before opening the app and after 5mins immediately. – nandu kathmandi Oct 07 '20 at 13:29
  • Create a Foreground Sevice by start a foregroud notification to keep alive when your app is closed – Lucas Zhang Oct 07 '20 at 13:34
  • Thanks! Can you please provide useful links or code details for foreground service for both iOS and Android. – nandu kathmandi Oct 08 '20 at 12:06
  • https://stackoverflow.com/questions/60028587/background-service-with-isolated-process-in-xamarin-forms/60032046#60032046 – Lucas Zhang Oct 08 '20 at 12:07

0 Answers0