The system resumes (or relaunches) your app in the background to do background fetches (
-application:performFetchWithCompletionHandler:
) based on its own internal criteria. The exact mechanics of this is not documented but you can learn more about the general approach by watching WWDC 2016 Session 204
What’s New with Multitasking. A key point here is that background fetch requests are (partly) determined by user activity, and thus the only way to really see it in action is to use your app like a real user would.
Oh, one thing I haven’t mentioned yet: it is common for your background fetch code to start tasks in an NSURLSession background session. The session will then resume (or relaunch) your app when those tasks are complete. So, a typical background fetch app will actually use two different ‘resuming in the background’ features:
background fetch, to kick off the network requests
NSURLSession background sessions, to process their results
You can also use more. For example, if your app talks to a service that always updates its results at a particular time, you can use ‘silent’ push notifications to start the app after the service has updated. This is commonly used by magazine style apps, which use a silent push to tell the clients that today’s content is available.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"