Contents

session(_:activationDidCompleteWith:error:)

Tells the delegate that the session has finished activating.

Declaration

func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: (any Error)?)

Parameters

  • session:

    The session object whose activation completed.

  • activationState:

    The state of the session. Sessions normally move to the Activated state upon success or the Notactivated state when there is an error. On iOS, the session may also move to the Inactive state if there is data waiting to be delivered from a previous session.

  • error:

    An error object indicating that a problem occurred or nil if activation completed successfully. When the activationState parameter contains the value Notactivated, this parameter contains the error object describing the reason for the failure.

Discussion

You must implement this method to support asynchronous activation and quick watch switching. Your implementation should check the value of the activationState parameter to see if communication with the counterpart app is possible. When the state is WCSessionActivationState.activated, you may communicate normally with the other app.

See Also

Managing Session Activation