Background Session Keys

Enable background sessions.

Overview

To use background sessions, enable the Background Modes capability for your WatchKit extension, and then select the desired modes (see Figure 1). Each mode sets its respective keys in the extension’s Info.plist file.

Figure 1

Enabling the Workout processing background mode

A screenshot showing the Workout processing background mode enabled.

The background modes allow your app to run in the background during a corresponding session. In general, your app needs to start the session in the foreground. Also, while the session is running, Apple Watch dispays your app whenever the user raises their wrist.

Topics

Information Property List Keys

property list key WKBackgroundModes

The services a Watch app provides that require it to continue running while in the background.

Name: Required background modes (Watch)
property list key UIBackgroundModes

Services provided by an app that require it to run in the background.

Name: Required background modes

See Also

Background Tasks

Running watchOS Apps in the Background

Schedule and perform background tasks from within your app.

Playing Background Audio

Enable background audio in your app to provide a seamless playback experience.

Preparing to Take Your watchOS App’s Snapshot

Use snapshot background tasks to provide a timely, accurate snapshot of your app.

class WKRefreshBackgroundTask

The abstract superclass for WatchKit's other background task classes.

class WKApplicationRefreshBackgroundTask

A background task used to update your app’s state in the background.

class WKURLSessionRefreshBackgroundTask

A background task that helps you respond to URLSession background transfers.

class WKWatchConnectivityRefreshBackgroundTask

A background task used to receive background updates from the Watch Connectivity framework.

class WKSnapshotRefreshBackgroundTask

A background task used to update your app’s user interface in preparation for a snapshot.

class WKIntentDidRunRefreshBackgroundTask

A background task used to update your app after a SiriKit intent runs.

class WKRelevantShortcutRefreshBackgroundTask

A background task used to periodically donate relevant Siri shortcuts.