mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-12-23 13:57:35 +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