mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-14 19:44:53 +00:00
Restart playing sound when interrupted by phone calls
This commit is contained in:
parent
1edc29c6fb
commit
b2ec730c88
@ -143,18 +143,10 @@
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle audio session interruption.
|
||||
* Restart playing sound when interrupted by phone calls.
|
||||
*/
|
||||
- (void) handleAudioSessionInterruption:(NSNotification*)notification {
|
||||
NSNumber* receivedType = [notification.userInfo
|
||||
valueForKey:AVAudioSessionInterruptionTypeKey];
|
||||
|
||||
NSNumber* expectedType = [NSNumber numberWithInt:AVAudioSessionInterruptionTypeEnded];
|
||||
|
||||
if ([receivedType isEqualToNumber:expectedType]) {
|
||||
[self configureAudioSession];
|
||||
[self keepAwake];
|
||||
}
|
||||
[self keepAwake];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user