Instance Method


Activates an audio session asynchronously on watchOS.


func activate(options: AVAudioSessionActivationOptions = [], completionHandler handler: @escaping (Bool, Error?) -> Void)



The options to apply when activating the session.


The callback the system invokes when the operation completes.


Use this method to play long-form audio—such as music, podcasts, or audio books—on Apple Watch. Before calling this method to activate longform playback, you must call setCategory(_:mode:policy:options:), set the category to playback, and route sharing policy to longForm.

This method asynchronously activates the audio session. The system calls the completion handler as soon as the session has successfully activated or if the activation fails.

Playback of long-form audio on watchOS requires a Bluetooth audio route. If necessary, the system presents an audio route picker to the user, letting them choose the Bluetooth route. If the user has previously selected a Bluetooth route or if AirPods or other W1-equipped Bluetooth headphones are nearby, the system automatically picks the audio route without displaying a picker view to the user. If no applicable Bluetooth route is selected (either automatically or by the user), the system passes an error to the completion handler.

See Also

Activating the Audio Session

func setActive(Bool, options: AVAudioSession.SetActiveOptions)

Activates or deactivates your app’s audio session using the specified options.