BackgroundTasks lets your app schedule and run deferrable maintenance and refresh work while it is in the background. You submit a BGTaskRequest subclass, such as a BGAppRefreshTaskRequest or BGProcessingTaskRequest, to the shared BGTaskScheduler, and the system later launches your app to perform the corresponding BGTask, like a BGAppRefreshTask or BGProcessingTask. The framework also provides specialized requests and tasks, including BGHealthResearchTask and BGContinuedProcessingTask, for distinct background scenarios across iOS, macOS, tvOS, watchOS, and visionOS.
Essentials 1
The shared scheduler that registers handlers and submits work to run while your app is in the background.
- ClBGTaskScheduleriOS 13.0+A class for scheduling task requests that launch your app in the background.
Background Tasks 5
The task objects the system launches your app to execute, providing completion and expiration handling.
- ClBGTaskiOS 13.0+An abstract class representing a task that’s run while the app is in the
- ClBGAppRefreshTaskiOS 13.0+An object representing a short task typically used to refresh content that’s
- ClBGProcessingTaskiOS 13.0+A time-consuming processing task that runs while the app is in the
- ClBGContinuedProcessingTaskiOS 26.0+A task meant to perform processing on behalf of a user initiated request.
- ClBGHealthResearchTaskiOS 17.0+A task meant to perform processing on behalf of health research studies.
Task Requests 5
The request objects you submit to the scheduler to ask the system to run a corresponding background task.
- ClBGTaskRequestiOS 13.0+An abstract class that represents a request for the app to be launched in the background to perform work.
- ClBGAppRefreshTaskRequestiOS 13.0+A request to launch your app in the background to execute a short refresh task.
- ClBGProcessingTaskRequestiOS 13.0+A request to launch your app in the background to execute a processing task that can take minutes to complete.
- ClBGContinuedProcessingTaskRequestiOS 26.0+A request to begin a workload immediately, or shortly after submission, which is allowed to continue running even if
- ClBGHealthResearchTaskRequestiOS 17.0+A request to launch your app in the background to execute a health research task for studies a user has opted into