Avaudiosession notifications not working sharedAudioPlayer = [[self alloc] init]; Once I use session with video, notification is never fired again, even if later audio is used only. videoChat, options: . . I'm working on an audio streaming app and I'm having troubles with interruptions. System alerts, such as receiving an incoming phone call, interrupt the active audio session. interruptionNotification already but still its not setting the session as desired when audio call is ended. As audioRecorderEndInterruption will be deprecated with iOS 9 I am focusing on AVAudioSession 's interruption notification (but neither is working as expected). When the app starts running again, it receives an interruption notification that the system has deactivated its audio session. try session. playAndRecord, mode: . duckOthers) try session. I've added my code below. This is particularly important if the interruption is a timer badge notification where most of your app is still visible. As audioRecorderEndInterruption will be deprecated with iOS 9 I am focusing on AVAudioSession 's interruption notification (but neither is working as expected). When the same happens on a phone call, or an *outgoing* FaceTime call the audio player resumes playing perfectly fine. The issue is that the interruption notification is never called if the app was and remains in the foreground when the interruption occurs. This notification is necessarily delayed in time because the system can only deliver it once the app is running again. If you prefer that the system not interrupt your app’s audio session in these cases, you can indicate this preference by setting a value for the setPrefersNoInterruptionsFromSystemAlerts(_:) method. setActive(true) When I then end the FaceTime call, I get the AVAudioSessionInterruptionNotification again. Here's my code. However we can use this state to stop animations or update the UI of our app to indicate audio has been suspended. Generally you activate your session and the system will deactivate it and notify you via a begin interruption. Although the default audio session provides useful behavior, it generally doesn’t provide the audio behavior a media app needs. Yes, you should always manage your apps audio session using AVAudioSession and handle interruptions as discussed in the above references. setCategory(. In iOS, locking a device silences the app’s audio. I have read that I should use AVAudioSessionInterruptionNotification, but my problem is it's getting called only when the interruption starts and not when it ends. I have used AVAudioSession. How can I fix that? I've found similar topic, but answer is to prompt and I don't fully get it. However, when I call 'play' on the AVAudioPlayer, I don't hear any audio starting. In iOS, setting the Ring/Silent switch to silent mode silences any audio the app is playing. qmmpcq jqsi hjisii tjdn aob zoijx qucee azhfr ylg wgg