Type Property

interruptionNotification

Posted when an audio interruption occurs.

Declaration

class let interruptionNotification: NSNotification.Name

Discussion

The userInfo dictionary of this notification contains the AVAudioSessionInterruptionTypeKey. If the interruption type is AVAudioSession.InterruptionType.began, the app’s audio session has been interrupted and is no longer active. If the interruption type is AVAudioSession.InterruptionType.ended, this dictionary also contains the AVAudioSessionInterruptionOptionKey key.

See Responding to Interruptions in Media Playback Programming Guide for more information on using this notification.

This notification is posted on the main thread.

Topics

User Info Keys

let AVAudioSessionInterruptionTypeKey: String

User info key to retrieve the interruption type.

let AVAudioSessionInterruptionOptionKey: String

User info key to retrieve the interruption option.

let AVAudioSessionInterruptionWasSuspendedKey: String

User info key to determine if the interruption is in response to the audio session being deactivated when the app process was suspended.

User Info Values

enum AVAudioSession.InterruptionType

Constants that describe the state of the audio interruption.

struct AVAudioSession.InterruptionOptions

A constant that indicates the state of the audio session following an interruption.

See Also

Responding to Audio Session Notifications

Responding to Audio Session Interruptions

Directly observe audio session notifications to ensure that your app responds to interruptions.

Responding to Audio Session Route Changes

Directly observe audio session notifications to ensure that your app responds to interruptions.

class let routeChangeNotification: NSNotification.Name

Posted when the system’s audio route changes.

class let silenceSecondaryAudioHintNotification: NSNotification.Name

Posted when the primary audio from other applications starts and stops.

class let mediaServicesWereLostNotification: NSNotification.Name

Posted when the media server is terminated.