Working on Apple's iBeacons, here is some code that I use to initialise CLLocationManager and start monitoring for beacon regions:
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.pausesLocationUpdatesAutomatically = false;
self.locationManager.allowsBackgroundLocationUpdates = true;
self.locationManager.delegate = self;
How much does pausesLocationUpdatesAutomatically play a part in region monitoring?
The official documentation says:
A Boolean value indicating whether the location manager object may pause location updates.
However the "Getting Started with iBeacons" official guide does not mention this. Plus it was last updated in 2014 and I haven't found any more on this.
- How does this affect battery life?
- How does this affect the iBeacon region detection?
If you check full description for
pausesLocationUpdatesAutomaticallyin documentation, you'll see explanation:And for
activityType:If you turn on
pausesLocationUpdatesAutomaticallyit'll start to monitor significant location changes and save battery since it is not using GPS so often.Region detection, in such case, will occur when there is significant change, so this check will be performed less often, tricky part here is how much is region detection important for you - if you decide to save battery will significant change detection be ok for region detection.
I hope this helps.