Sample Code

Refreshing and Maintaining Your App Using Background Tasks

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



This sample code project must be run on a physical device.

See Also


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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software