2

I am developing an iOS app that uses permanently in background the Location Service to monitor Beacons and GPS regions. This causes my app to uselessly consume the battery if the device is not near the location of my iBeacons. It also always shows the Location Service blue arrow in the status bar, which gives my users a bad perception of my app.

I would like to be able to avoid using the Location Service permanently but still be able to detect iBeacons. I thought that waking up my app periodically to check location to see if the device is near the location of my iBeacons would save battery and allow me to locate the device without having the Location Service blue arrow always showed up in the status bar.

Is this solution possible? Or do you think there is a better solution?

Raphael Royer-Rivard
  • 2,252
  • 1
  • 30
  • 53

2 Answers2

1

iOS already optimizes for battery usage when looking for beacons when your app is in the background. My testing shows that extra battery usage is minimal and that the blue arrow location icon does not show up when your app is in the background, excerpt for very brief periods (about 10 seconds) where beacons have temporarily awakened your app into the background after beacon detection.

Are you sure it is your app that is making the blue arrow show up? Does this really happen in the background for long periods of time? Do you have location background mode unnecessarily set in your plist?

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • You are right, monitoring a `CLBeaconRegion` do not show a solid arrow in the status bar, only an empty one. My guess is that it will be the same if I monitor a CLCircularRegion (GPS), it will show the same empty arrow in the status bar. Do you know which of those two types of region is the more power efficient? – Raphael Royer-Rivard Sep 25 '14 at 19:13
  • I think both are gentle on the battery. Sorry, I do not know which is more efficient. – davidgyoung Sep 26 '14 at 17:43
0

After iOS 7.1 apple had optimize there beacon services. Now you will get, regions nearby you. While application is hard close you ll get local notification. You can use these methods for extra code :-

-(void)locationManager:(CLLocationManager *)manager
        didEnterRegion:(CLRegion *)region {
}
-(void)locationManager:(CLLocationManager *)manager
         didExitRegion:(CLRegion *)region {
}

As @davidgyoung said that iOS already optimizes for battery usage so don't worry. :)

Gaurav Govilkar
  • 154
  • 1
  • 1
  • 10
  • 1
    Yes that are the methods I will use, but do you know if there have been battery consumption tests done to determine if the monitoring of `CLCircularRegion` is more power efficient than monitoring `CLBeaconRegion`? – Raphael Royer-Rivard Sep 26 '14 at 15:30
  • I guess you can do this by Instrumentation(system Trace). You can use both to know that which one is efficient. – Gaurav Govilkar Sep 29 '14 at 07:22