Instance Method

startAtDate:

Schedules a session to start running at a future date.

Declaration

- (void)startAtDate:(NSDate *)date;

Parameters

date

The time and date when the session starts running.

Discussion

Use startAtDate: to set up a scheduable session. You must call this method while your app is running in the foreground. However, when the scheduled date and time arrives, the session starts running regardless of your app’s current state. If your app isn’t running, the system launches your app and calls your extension delegate’s handleExtendedRuntimeSession: method to start the session. If you don’t set the session’s delegate in the handleExtendedRuntimeSession: method, the system ends the session.

If you call this method with a date that has already passed, the system tries to immediately starts the session, but the session is only given 30 minutes from the provided date. If the date is more than one minute in the past, this method fails.

See Also

Managing the Session State

- start

Starts running the session.

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