Remove unused constant kAPPBackgroundEventFailure

This commit is contained in:
Sebastián Katzer 2017-01-27 16:47:52 +01:00
parent eeacef9ade
commit 17fbc6981d

View File

@ -31,7 +31,6 @@
NSString* const kAPPBackgroundJsNamespace = @"cordova.plugins.backgroundMode"; NSString* const kAPPBackgroundJsNamespace = @"cordova.plugins.backgroundMode";
NSString* const kAPPBackgroundEventActivate = @"activate"; NSString* const kAPPBackgroundEventActivate = @"activate";
NSString* const kAPPBackgroundEventDeactivate = @"deactivate"; NSString* const kAPPBackgroundEventDeactivate = @"deactivate";
NSString* const kAPPBackgroundEventFailure = @"failure";
#pragma mark - #pragma mark -
@ -66,7 +65,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
{ {
NSNotificationCenter* listener = [NSNotificationCenter NSNotificationCenter* listener = [NSNotificationCenter
defaultCenter]; defaultCenter];
[listener addObserver:self [listener addObserver:self
selector:@selector(keepAwake) selector:@selector(keepAwake)
name:UIApplicationDidEnterBackgroundNotification name:UIApplicationDidEnterBackgroundNotification
@ -76,7 +75,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
selector:@selector(stopKeepingAwake) selector:@selector(stopKeepingAwake)
name:UIApplicationWillEnterForegroundNotification name:UIApplicationWillEnterForegroundNotification
object:nil]; object:nil];
if ([self.class isRunningWebKit]) if ([self.class isRunningWebKit])
return; return;
@ -97,7 +96,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
{ {
if (enabled) if (enabled)
return; return;
enabled = YES; enabled = YES;
[self execCallback:command]; [self execCallback:command];
} }
@ -110,7 +109,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
{ {
if (!enabled || [self.class isRunningWebKit]) if (!enabled || [self.class isRunningWebKit])
return; return;
enabled = NO; enabled = NO;
[self stopKeepingAwake]; [self stopKeepingAwake];
[self execCallback:command]; [self execCallback:command];
@ -130,7 +129,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
if (![self.class isRunningWebKit]) { if (![self.class isRunningWebKit]) {
[audioPlayer play]; [audioPlayer play];
} }
[self fireEvent:kAPPBackgroundEventActivate]; [self fireEvent:kAPPBackgroundEventActivate];
} }
@ -178,7 +177,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
if ([self.class isRunningWebKit]) if ([self.class isRunningWebKit])
return; return;
// Don't activate the audio session yet // Don't activate the audio session yet
[session setActive:NO error:NULL]; [session setActive:NO error:NULL];
@ -256,7 +255,7 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
{ {
NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ=="; NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ==";
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0]; NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
} }