Instance Method

invalidate

Stops the session.

Declaration

- (void)invalidate;

Discussion

This method stops a running session. If you’ve scheduled a session, it cancels the session. If the session isn’t yet running or scheduled, this method triggers a WKExtendedRuntimeSessionErrorNotYetStarted error.

For sessions started with startAtDate:, you can only call invalidate when the app is active. For all other sessions, you can call invalidate to end a session at any time.

After calling invalidate, you can no longer run the session. Create and start a new session instead.

See Also

Managing the Session State

- start

Starts running the session.

- startAtDate:

Schedules a session to start running at a future date.

state

The session’s current state.

WKExtendedRuntimeSessionState

The activation states for an extended runtime session.

expirationDate

The time and date when the session expires.