Implementing the prerequisites for background fetch
There are three steps involved in supporting background fetch in your app:
- Add the background fetch capability to your app.
- Ask iOS to wake your app up.
- Implement
application(_:performFetchWithCompletionHandler:)
inAppDelegate
.
You can implement step 1 and 2 right now; step 3 will be implemented separately because this step will involve writing the code to fetch and update the movies using a helper struct.
Adding the background fetch capability
Every application has a list of capabilities they can opt in to. Some examples of these capabilities are using Maps, HomeKit, and Background Modes. You can find the Capabilities tab in your project settings. If you select your project in the file navigator, you can see the Capabilities tab right next to your app's General settings.
If you select this tab, you will see a list of all the capabilities your app can implement. If you expand a capability, you'll find some information about what the capability...