1

(This question has been asked before, but the last helpful response is from 2013 and is outdated)

My team is currently working on developing an application that will periodically, every 30 min or so, take a users location and store it. The time intervals that we take a users location is not as important as the accuracy of the location. We are trying to balance battery efficiency with location accuracy. One method that we believe will help with battery efficiency is take users location less frequently during non peak use periods. Other than that after reviewing apples best practice documentation it seams like we may be able to use the Significant Location Change Service to activate the Standard Location Service upon significant location change, but I am not sure how accurate this method will be.

What is the best way to periodically take a users location, while conserving battery life?

John Smith
  • 7,243
  • 6
  • 49
  • 61
  • As apple said: use significant location service and once you get the significant location update use location service (GPS) to obtain precise location. The process remained almost the same over ios releases. – Ayan Sengupta Aug 17 '16 at 23:34
  • @AyanSengupta How accurate is the slc and would you recommend running it continuously or periodically? – Samuel Krut Aug 17 '16 at 23:35
  • Significant location update comes from your cell towers. So it's much less expensive than actually using GPS. And the accuracy / performance tradeoff solely depends on the requirements of your app. I'm not an expert to comment on that. – Ayan Sengupta Aug 17 '16 at 23:38
  • What iOS version are you targetting? If you target iOS9+ then you can use the `requestLocation` method of `CLLocationManager` to get a single, accurate location. You can use the significant location change to initiate this. If you are targeting earlier versions of iOS then you have to implement this functionality yourself by turning on location updates with high accuracy and then turning them off once you have an accurate location or a given amount of time has passed – Paulw11 Aug 17 '16 at 23:41
  • @Paulw11 We currently have a significant amount of users using iOS7. So I would not be able to use SLC? So the best option would be to turn on location updates every x minutes at a pre specified accuracy? – Samuel Krut Aug 17 '16 at 23:58
  • You can still use SLC - It has been around for a long time and it is the best low-power option to trigger location updates. You just can't use the simple `requestLocation` method - you will need to build that logic for yourself. – Paulw11 Aug 18 '16 at 00:01
  • Hello check my answer to this post: http://stackoverflow.com/a/36194283/5229157, you can achieve this by playing around with the location accuracy and the different updates available by the location manager. – Daniel Ormeño Aug 18 '16 at 06:01

0 Answers0