Who is this for?
This course is for anyone interested in running background tasks in their iOS application or just learning about the framework introduced by Apple.
- Background Tasks framework
- Launching tasks in the background
Part 1: Background Tasks in iOS
To get started using the Background Tasks framework, we need to setup our project capabilities. These capabilities allow Xcode to recognise that you would like to use background tasks. You also need to create some new values within the Info.plist.
Background Tasks framework requires you to register every background task that is required. You do this via identifiers and registering with the framework. You also need to declare these identifiers inside the Info.plist.
Handle App Refresh
Your background task is going to hit this API and download an updated list from the API, so that when a user returns they can see the latest music very quickly. In this episode you will write the logic to handle this refresh.
In the Background Task framework we also get access to a processing task, this is primarily used for intensive tasks such as training an ML model or cleaning a database. In this episode, explore scheduling a processing task and how this could work for you in your iOS app.
In this episode, explore all the ways of testing a background task. It can be quite daunting when you have done all this logic and wonder what is the best way to make sure this happens in the cirumstances you want.