Commit 98b8fc25 authored by Chris Scott's avatar Chris Scott

Remove dispatch_async stuff in ending bgTask

parent 13d8b881
...@@ -80,10 +80,11 @@ ...@@ -80,10 +80,11 @@
*/ */
- (void) start:(CDVInvokedUrlCommand*)command - (void) start:(CDVInvokedUrlCommand*)command
{ {
NSLog(@"- CDVBackgroundGeoLocation start");
enabled = YES; enabled = YES;
UIApplicationState state = [[UIApplication sharedApplication] applicationState]; UIApplicationState state = [[UIApplication sharedApplication] applicationState];
NSLog(@"- CDVBackgroundGeoLocation start (background? %d)", state);
if (state == UIApplicationStateBackground) { if (state == UIApplicationStateBackground) {
[self setPace:isMoving]; [self setPace:isMoving];
} }
...@@ -173,9 +174,7 @@ ...@@ -173,9 +174,7 @@
UIApplication *app = [UIApplication sharedApplication]; UIApplication *app = [UIApplication sharedApplication];
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{ bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
dispatch_async(dispatch_get_main_queue(), ^{
[self stopBackgroundTask]; [self stopBackgroundTask];
});
}]; }];
[self.commandDelegate runInBackground:^{ [self.commandDelegate runInBackground:^{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment