Global Variable

AVAudioSessionInterruptionNotification

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

Declaration

const NSNotificationName AVAudioSessionInterruptionNotification;

Discussion

The notification’s user-information dictionary contains the AVAudioSessionInterruptionTypeKey key. If the interruption type is AVAudioSessionInterruptionTypeBegan, the system interrupted your app’s audio session and it’s no longer active. If the interruption type is AVAudioSessionInterruptionTypeEnded, 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

AVAudioSessionInterruptionTypeKey

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

AVAudioSessionInterruptionOptionKey

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

AVAudioSessionInterruptionWasSuspendedKey

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

AVAudioSessionInterruptionType

Constants that describe the state of the audio interruption.

AVAudioSessionInterruptionOptions

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.

Interruption Flags

Constants that indicate the state of the audio session following an interruption.

AVAudioSessionRouteChangeNotification

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

AVAudioSessionSilenceSecondaryAudioHintNotification

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

AVAudioSessionMediaServicesWereLostNotification

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

AVAudioSessionMediaServicesWereResetNotification

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