Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard Location Service battery drain on iOS

I noticed that if I have an application using Significant Location Change it does take approximately 30% of my battery over 24H. I thought that SLC was not supposed to drain the battery.

Is this behaviour normal? We made our tests scientifically on an iPhone 6 with iOS 8.3 and 8.4. We also tried on an iPhone 5c (iOS 8.3 and 8.4).

like image 644
poiuytrez Avatar asked Jul 20 '15 15:07

poiuytrez


1 Answers

There are several options on CLLocationManager and you must use them intelligently or you will see unanticipated battery drain.

1- when you invoke the startMonitoringSignificantLocationChanges method be sure you have not already called startUpdatingLocation otherwise make sure you stop it with stopUpdatingLocation before you use significant distance.

2- Check your settings for pausesAutomatically and allow deferred updates. These will impact things substantially.

3-If you don't need beacons, visits or geofencing turn that off. As these can force LM into higher battery drain modes.

4- You should also check to see what logic you execute when you receive a location update. Notifications which turn on the screen and network calls which may spin up the wifi and cell service will add significantly more battery drain to your device than the location manager alone.

You might also checkout https://LocationKit.io for a cocoapod designed to optimize location services for high accuracy and low power. Full disclosure I work for the company that makes LocationKit.

like image 193
John Fontaine Avatar answered Sep 21 '22 07:09

John Fontaine