Global Variable

AVAudioSessionInterruptionNotification

Posted when an audio interruption occurs.

Declaration

const NSNotificationName AVAudioSessionInterruptionNotification;

Discussion

The userInfo dictionary of this notification contains the AVAudioSessionInterruptionTypeKey. If the interruption type is AVAudioSessionInterruptionTypeBegan, the app’s audio session has been interrupted and is no longer active. If the interruption type is AVAudioSessionInterruptionTypeEnded, 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

AVAudioSessionInterruptionTypeKey

User info key to retrieve the interruption type.

AVAudioSessionInterruptionOptionKey

User info key to retrieve the interruption option.

AVAudioSessionInterruptionWasSuspendedKey

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

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

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.

AVAudioSessionRouteChangeNotification

Posted when the system’s audio route changes.

AVAudioSessionSilenceSecondaryAudioHintNotification

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

AVAudioSessionMediaServicesWereLostNotification

Posted when the media server is terminated.

AVAudioSessionMediaServicesWereResetNotification

Posted when the media server restarts.