Commit 16309141 authored by Chris Scott's avatar Chris Scott

Always ON significant-changes seems to keep app running in bg

parent f39d5b14
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
NSLog(@"- CDVBackgroundGeoLocation start (background? %d)", state); NSLog(@"- CDVBackgroundGeoLocation start (background? %d)", state);
[locationManager startMonitoringSignificantLocationChanges];
if (state == UIApplicationStateBackground) { if (state == UIApplicationStateBackground) {
[self setPace:isMoving]; [self setPace:isMoving];
} }
...@@ -259,7 +260,6 @@ ...@@ -259,7 +260,6 @@
{ {
NSLog(@"- CDVBackgroundGeoLocation resume"); NSLog(@"- CDVBackgroundGeoLocation resume");
if (enabled) { if (enabled) {
[locationManager stopMonitoringSignificantLocationChanges];
[locationManager stopUpdatingLocation]; [locationManager stopUpdatingLocation];
} }
} }
...@@ -477,7 +477,6 @@ ...@@ -477,7 +477,6 @@
isAcquiringSpeed = YES; isAcquiringSpeed = YES;
speedAcquisitionAttempts = 0; speedAcquisitionAttempts = 0;
[locationManager stopMonitoringSignificantLocationChanges];
locationManager.distanceFilter = distanceFilter; locationManager.distanceFilter = distanceFilter;
// Power-up the GPS temporarily until we get a good speed sample. // Power-up the GPS temporarily until we get a good speed sample.
locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.desiredAccuracy = kCLLocationAccuracyBest;
...@@ -509,7 +508,6 @@ ...@@ -509,7 +508,6 @@
[locationManager stopUpdatingLocation]; [locationManager stopUpdatingLocation];
locationManager.distanceFilter = distanceFilter; locationManager.distanceFilter = distanceFilter;
locationManager.desiredAccuracy = desiredAccuracy; locationManager.desiredAccuracy = desiredAccuracy;
[locationManager startMonitoringSignificantLocationChanges];
stationaryRegion = [[CLCircularRegion alloc] initWithCenter: coord radius:stationaryRadius identifier:@"BackgroundGeoLocation stationary region"]; stationaryRegion = [[CLCircularRegion alloc] initWithCenter: coord radius:stationaryRadius identifier:@"BackgroundGeoLocation stationary region"];
stationaryRegion.notifyOnExit = YES; stationaryRegion.notifyOnExit = YES;
......
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