简体   繁体   中英

How to do hourly location updates without keeping the icon on?

I'm building a location-based App, but I hate having the location services icon on. I only need coordinates once per hour on a set schedule.

Apps like Glassmap only turn location services' icon on once an hour when updating, but I can't figure out how to do this on a schedule in the background without saying the App is a VoIP, which it's not.

What is a trick to make this work that's App Store acceptable?

You can use location in the UIBackgroundModes of your app, see the documentation .

About the location services icon on, I think you should leave it. It's a fair feedback for your user. A user has to know its position is being tracked and leaving the icon on for a few seconds each time the geolocation actually happens wouldn't be fair. (and it sounds like a case of app rejection to me).

As long as you don't have a negative impact on the device battery, the user will be grateful you let it know you're tracking his position.

For instance, apps such as OpenPaths made my iPhone show the location icon on all the time and have no real negative impact on the battery.

I would register for significant location change updates. When updates happen compare timestamp with last update. Use update if time delta > 60 minutes. Worst case: I believe you get the location indicator outline. this tells the user that a kind of tracking is happening — but not all the time, so it' not a battery issue and you don't get too many support requests. Best case: Registering for significant location change update doesn't show the indicator outline. But I am not certain. Completely without icon might just not be possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM