Type Property

interruptionNotification

A notification that’s posted when an audio interruption occurs.

Declaration

class let interruptionNotification: NSNotification.Name

Discussion

The notification’s user-information dictionary contains the AVAudioSessionInterruptionTypeKey key. If the interruption type is AVAudioSession.InterruptionType.began, the system interrupted your app’s audio session and it’s no longer active. If the interruption type is AVAudioSession.InterruptionType.ended, this dictionary also contains the AVAudioSessionInterruptionOptionKey key.

See Responding to Audio Session Interruptions for more information on using this notification.

The system posts this notification on the main thread.

Topics

User Info Keys

let AVAudioSessionInterruptionTypeKey: String

A user info key that’s used to retrieve the interruption type.

let AVAudioSessionInterruptionOptionKey: String

A user info key that’s used to retrieve the interruption option.

let AVAudioSessionInterruptionWasSuspendedKey: String

A user info key that’s used to determine if the interruption is due to the audio session being deactivated when the system suspended the app.

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

Observe audio session notifications to ensure that your app responds appropriately to interruptions.

Responding to Audio Session Route Changes

Observe audio session notifications to ensure that your app responds appropriately to route changes.

class let routeChangeNotification: NSNotification.Name

A notification that’s posted when the system’s audio route changes.

class let silenceSecondaryAudioHintNotification: NSNotification.Name

A notification that’s posted when the primary audio from other applications starts and stops.

class let mediaServicesWereLostNotification: NSNotification.Name

A notification that’s posted when the system terminates the media server.

class let mediaServicesWereResetNotification: NSNotification.Name

A notification that’s posted when the media server restarts.