I create an avaudiosession in my app delegate and add an observer.
AVAudioSession *sessionInstance = [AVAudioSession sharedInstance];
[sessionInstance setCategory:AVAudioSessionCategoryPlayback error:&error];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleInterruption:)
name:AVAudioSessionInterruptionNotification
object:nil];
[sessionInstance setActive:YES error:&error];
When there is a phone call, it calls selector handleInterruption method. But, when the phone call is end, it does not call handleInterruption for the interruption type AVAudioSessionInterruptionTypeEnded.
Instead, it delegates
- (void)observeValueForKeyPath:(NSString*) path
ofObject:(id)object
change:(NSDictionary*)change
context:(void*)context
method for the status key of music player item.
How can i handle this?