Class

WKExtendedRuntimeSession

A session that continues to run your app after the user has stopped interacting.

Declaration

@interface WKExtendedRuntimeSession : NSObject

Overview

With extended runtime sessions, your app continues to run after the user stops interacting with it. The app can continue to communicate with Bluetooth devices, process data, or play sounds or haptics, even after the watch’s screen turns off.

Each app can support a single type of extended runtime session: self care, mindfulness, physical therapy, smart alarm, or health monitoring. Select the session by enabling the appropriate Background Modes capability.

For more information, see Using Extended Runtime Sessions.

Topics

Creating a Session

+ session

Instantiates a new session object.

delegate

A delegate object for monitoring the session and responding to state changes and errors.

WKExtendedRuntimeSessionDelegate

A set of optional methods for monitoring an extended runtime session.

Managing the Session State

- start

Starts running the session.

- startAtDate:

Schedules a session to start running at a future date.

- invalidate

Stops the session.

state

The session’s current state.

WKExtendedRuntimeSessionState

The activation states for an extended runtime session.

expirationDate

The time and date when the session expires.

Alerting the User

- notifyUserWithHaptic:repeatHandler:

Play a repeating haptic alert.

Relationships

Inherits From

See Also

Extended Runtime Sessions

Using Extended Runtime Sessions

Create an extended runtime session that continues running your app after the user stops interacting with it.

WKExtendedRuntimeSessionErrorCode

The error codes reported by extended runtime sessions.

WKExtendedRuntimeSessionErrorDomain

The domain for errors reported by extended runtime sessions.