mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-14 19:44:53 +00:00
Merge branch 'master' of bitbucket.org:TheBosZ/cordova-plugin-run-in-background
This commit is contained in:
commit
b33044c8e5
@ -174,6 +174,9 @@ NSString* const kAPPBackgroundEventDeactivate = @"deactivate";
|
|||||||
// even another app starts playing sound
|
// even another app starts playing sound
|
||||||
[session setCategory:AVAudioSessionCategoryPlayback
|
[session setCategory:AVAudioSessionCategoryPlayback
|
||||||
error:NULL];
|
error:NULL];
|
||||||
|
// Prevent sound/music from stopping when opening the app. Also prevents embedded videos from pausing when unmuted.
|
||||||
|
[session setCategory:AVAudioSessionCategoryAmbient
|
||||||
|
error:NULL];
|
||||||
|
|
||||||
// Active the audio session
|
// Active the audio session
|
||||||
[session setActive:YES error:NULL];
|
[session setActive:YES error:NULL];
|
||||||
@ -222,7 +225,7 @@ NSString* const kAPPBackgroundEventDeactivate = @"deactivate";
|
|||||||
NSString* flag = [NSString stringWithFormat:@"%@._isActive=%@;",
|
NSString* flag = [NSString stringWithFormat:@"%@._isActive=%@;",
|
||||||
kAPPBackgroundJsNamespace, active];
|
kAPPBackgroundJsNamespace, active];
|
||||||
|
|
||||||
NSString* depFn = [NSString stringWithFormat:@"%@.on%@();",
|
NSString* depFn = [NSString stringWithFormat:@"%@.on('%@');",
|
||||||
kAPPBackgroundJsNamespace, event];
|
kAPPBackgroundJsNamespace, event];
|
||||||
|
|
||||||
NSString* fn = [NSString stringWithFormat:@"%@.fireEvent('%@');",
|
NSString* fn = [NSString stringWithFormat:@"%@.fireEvent('%@');",
|
||||||
|
Loading…
Reference in New Issue
Block a user