I'l like to know
A) if it's possible to completely switch off the use of gps when the App is in background mode and I terminate it (long press on "home button", tap on the "X" of the corresponding task), even if "region monitoring" is active and there is the corresponding active flag in the App .plst .
Also I'd like to recap how you can monitor the device location; I think there are three ways: - [locationManager startUpdatingLocation] - [locationManager startMonitoringSignificantLocationChanges]; - [locationManager startMonitoringForRegion:region desiredAccuracy:accuracy];
B) i don't understand if they "can"/"may not"/"have to" run at the same time. for example: startUpdatingLocation and startMonitoringSignificantLocationChanges are mutually exclusive and that's ok, but what about startMonitoringForRegion?
C) Can i use only startMonitoringForRegion without startMonitoringSignificantLocationChanges?
D) if i use both at the same time, may i receive two notifications while entering/exiting a monitored region? How can I avoid it? I this case, think i should implement something like this:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
BOOL crossedBoundary = [self checkIfNewLocationHasCrossedMyMonitoredRegionBoundary:newLocation ];
if (crossedBoundary) NSLog(@"Crossed the boundary");
}
AND
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { NSLog(@"Crossed the boundary"); }
E) How can i turn off/on startMonitoringForRegion while the App is in background?
Thanks very much. I'm starting from "Regions" and "breadCrumb" Apple example https://developer.apple.com/library/ios/#samplecode/Breadcrumb/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010048-Intro-DontLinkElementID_2
https://developer.apple.com/library/ios/#samplecode/Regions/Introduction/Intro.html