How much does pausesLocationUpdatesAutomatically affect iBeacon detection?

1.3k Views Asked by At

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?
2

There are 2 best solutions below

6
gvuksic On

If you check full description for pausesLocationUpdatesAutomatically in documentation, you'll see explanation:

Allowing the location manager to pause updates can improve battery life on the target device without sacrificing location data. When this property is set to YES, the location manager pauses updates (and powers down the appropriate hardware) at times when the location data is unlikely to change. For example, if the user stops for food while using a navigation app, the location manager might pause updates for a period of time. You can help the determination of when to pause location updates by assigning a value to the activityType property.

And for activityType:

The location manager uses the information in this property as a cue to determine when location updates may be automatically paused. Pausing updates gives the system the opportunity to save power in situations where the user's location is not likely to be changing. For example, if the activity type is CLActivityTypeAutomotiveNavigation and no location changes have occurred recently, the radios might be powered down until movement is detected again.

If you turn on pausesLocationUpdatesAutomatically it'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.

0
Paulw11 On

Location updates and beacon detection are not related.

iBeacon detection uses the Bluetooth chipset and doesn't provide you with a location as such. It just tells you that you entered (or exited) a CLBeaconRegion.

CLCircularRegion detection is different; this relies on determining the user's latitude and longitude; either by GPS or WiFi. GPS has a significant impact on battery life.

So, the short answer is that pausesLocationUpdatesAutomatically shouldn't have any impact on beacon detection.