Class

WKWatchConnectivityRefreshBackgroundTask

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

Declaration

class WKWatchConnectivityRefreshBackgroundTask : WKRefreshBackgroundTask

Overview

Do not subclass or create instances of this class. Instead, when this background watch connectivity task is triggered, the system launches your app in the background, instantiates a WKWatchConnectivityRefreshBackgroundTask object, and passes the task object to your extension delegate’s handle(_:) method.

Background watch connectivity tasks are triggered whenever the paired device sends data using one of the following WCSession methods:

The background watch connectivity task informs you that your app has been given background time. You must use your WCSessionDelegate methods to receive this data. Because of the asynchronous nature of these tasks, you must defer calling your tasks’s setTaskCompleted() method until after you have activated your session and received all the pending data. Use the hasContentPending method to determine whether you still have any pending data.

Relationships

Conforms To

See Also

Background Tasks

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 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.