Get the status for a background task

ChristianMuehleChristianMuehle DEUniversity
edited January 2017 in Xamarin.iOS

Hi Everybody

We just started with the iOS part of our App and I´m a little bit confused related to backgrounding in iOS or better getting the current state of a running Task.
Given this example:

  • User starts the app the first time, initial data set up using this code

var CurrentTaskID = UIApplication.SharedApplication.BeginBackgroundTask(ServiceName, TimeExpired);
//Do work for the user
UIApplication.SharedApplication.EndBackgroundTask(CurrentTaskID);

  • During this process (100% less than 10 minutes) he gets a phone call
  • Quick call, he opens the application again

How do I get the status of this task that I started in step 1? Of course I want to prevent the system starting the same process again, one database is enough ;)

Thanks in advance
Chris

Sign In or Register to comment.