Framework

BackgroundTasks

Request the system to launch your app in the background to run tasks.

Overview

Use the BackgroundTasks framework to keep your app content up to date and run tasks requiring minutes to complete while your app is in the background. Longer tasks can optionally require a powered device and network connectivity.

Register launch handlers for tasks when the app launches and schedule them as required. The system will launch your app in the background and execute the tasks.

Topics

Essentials

class BGTaskScheduler

A class for registering launch handlers that are run by submitting task requests to launch your app in the background.

Starting and Terminating Tasks During Development

Use the debugger to start tasks and terminate them before completion during development.

Refreshing and Maintaining Your App Using Background Tasks

Use scheduled background tasks for refreshing your app content and for performing maintenance.

Requests

class BGProcessingTaskRequest

A request to launch your app in the background to execute a processing task that can take minutes to complete.

class BGAppRefreshTaskRequest

A request to launch your app in the background to execute a short refresh task.

class BGTaskRequest

An abstract class for representing task requests.

Task Management

class BGProcessingTask

A time-consuming processing task that runs while the app is in the background.

class BGAppRefreshTask

An object representing a short task typically used to refresh content that’s run while the app is in the background.

class BGTask

An abstract class representing a task that’s run while the app is in the background.