I need support for iBeacon Technology. In our case, I want one feature of continuously scanning (Ranging) of iBeacons weather our app is in foreground or background. We know its possible with CLLocationManager standard update location methods. But we don’t want to go with standard Location Updates (As we don’t want to take risk of battery drain). Is there any other option to start continuous Ranging of CLBeaconRegion without using CLLocationManager?
2 Answers
I am using Estimote Beacons and there are delegate methods or Estimate SDK(ESTBeaconManager class) available "https://github.com/Estimote/iOS-SDK", whenever beacons come in range or goes out of range,below said delegate methods will be called internally and help us to reduce battery drain.We can place the proximity checks in didEnterRegion Method:
- (void)beaconManager:(ESTBeaconManager *)manager didEnterRegion:(ESTBeaconRegion *)region{}
- (void)beaconManager:(ESTBeaconManager *)manager didExitRegion:(ESTBeaconRegion *)region{}
- (void)beaconConnectionDidSucceeded:(ESTBeacon*)beacon{}
- (void)beaconConnectionDidFail:(ESTBeacon*)beacon withError:(NSError*)error{}
- (void)beaconManager:(ESTBeaconManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region{}

- 319
- 2
- 13

- 304
- 3
- 4
The only way you can detect iBeacon transmissions on iOS is with CoreLocation, and you are correct that constant ranging does drain the battery significantly.
In theory you could use CoreBluetooth to detect other beacon types like AltBeacon (reading iBeacon advertisement details are blocked by CoreBluetooth), but battery usage would still be similar.
The standard way to save battery in the background is to use CoreLocation beacon monitoring APIs, which are easier on the battery. Then when a beacon is detected by these monitoring APIs, you can start ranging, even if your app is in the background.
For more info on extending background ranging time, see here: http://developer.radiusnetworks.com/2014/11/13/extending-background-ranging-on-ios.html

- 63,876
- 14
- 121
- 204
-
Hi David, thanks for your response. I went through your article but it says that we can only extend the background ranging by 3 minutes. Our apps requirements are to continuously scan till it exits the region. Is it possible at all to do continuous ranging in background mode (even when application is not alive) in iOS? We are achieving continuous scanning in background (even when app is not alive) by using standard location updates of ClLocationManager class. We even wrote a disclaimer about battery usage but Apple still rejected our app. – navjot mehra Dec 24 '14 at 08:42
-
Yes, I am not surprised Apple rejected it. Whether right or wrong, you typically need to have a direct and obvious purpose to doing background location updates to get approval for such use in apps in the AppStore. This typically means it must be a navigation app. It is a fair criticism to say Apple does not support this use case for other purposes. I cannot speak for Apple, but I believe the rationale is simply to preserve battery life. – davidgyoung Dec 24 '14 at 13:38