Geofencing Indicators vs. Location Services Indicator

I have an application that displays a map of the user's location and tracks the user until the application is moved to the background. At this point, the location manager is informed to stop updating the location and instead monitor the region (radius 100 meters around the last known location). On the iOS simulator, it works as expected, and shows the Geofencing indicator (the same as the service indicator for ordinary places, but only the outline). On the iPhone, it seems to work as expected, but displays the location service icon, not just the outline.

Are there any reasons this could happen is the mismatch between the simulator and the phone? I just want to make sure that the phone actually only uses Geofencing and no other services (i.e. to ensure minimal battery usage).

Additional Information:

I need a background mode to receive location updates - this happens in certain cases (when the user allows it), and not all the time. However, I tried to disable this and the problem persists.

The code that I use for the background configuration of the application:

- (void)applicationDidEnterBackground:(UIApplication *)application { // Only monitor significant changes – unless specified if(!self.viewController.userSpecifiedToUseLocationServices) { // Stop using full location services [self.viewController.locationManager stopUpdatingLocation]; // Create a boundary -- a circle around the current location self.viewController.currentBoundary = [[CLRegion alloc] initCircularRegionWithCenter:self.viewController.locationManager.location.coordinate radius:kSignificantLocationChange identifier:@"Current Location Boundary"]; // Monitor the boundary [self.viewController.locationManager startMonitoringForRegion:self.viewController.currentBoundary desiredAccuracy:kCLLocationAccuracyBest]; } } - (void)applicationDidBecomeActive:(UIApplication *)application { // Stop monitoring the region if(self.viewController.currentBoundary != nil) { [self.viewController.locationManager stopMonitoringForRegion:self.viewController.currentBoundary]; self.viewController.currentBoundary = nil; } // Start full location services again [self.viewController.locationManager startUpdatingLocation]; } 
+4
source share
1 answer

Well, first of all, location services on simulators have never been high-precision representations of real devices. Therefore, I would not assume that you will see the same thing on both test platforms.

Secondly, according to this answer to the stack overflow , this is similar to the normal behavior on iOS 5 (showing different indicators).

I would also caution that geoprocessing is not a magical technology. The device still needs to use location services, and this will lead to battery leakage. I would recommend using Apple startMonitoringForRegion: or startMonitoringForRegion:desiredAccuracy: and use their implementation, rather than encode your own. But I also did not expect the battery leak to be negligible.

Finally, you specify accuracy as kCLLocationAccuracyBest , rather than using startMonitoringForRegion: or specifying a requirement for less precision. I do not see how this does not affect battery performance. Greater accuracy means that the OS will either have to get a higher quality patch, or poll more regularly, or both.

Unfortunately, there are no free dinners :(

+5
source

All Articles