gpt4 book ai didi

iphone - 后台位置跟踪: iOS

转载 作者:行者123 更新时间:2023-12-03 21:20:09 27 4
gpt4 key购买 nike

我正在尝试在 Apple 的重要位置更改服务和自己定期启动/停止位置管理器之间做出选择。苹果对此是这样说的:

Gathering location data is a power-intensive operation. It involves powering up the onboard radios and querying the available cell towers, Wi-Fi hotspots, or GPS satellites, which can take several seconds. Leaving the standard location service running for extended periods can drain the device’s battery. (The significant-change location service drastically reduces battery drain by monitoring only cell tower changes, but the service works only on devices with cellular radios.) For most applications, it is usually sufficient to establish an initial position fix and then acquire updates only periodically after that. If you are sure you need regular position updates, you should use the significant-change location service where you can; otherwise, you should configure the parameters of the standard location service in a way that minimizes its impact on battery life.

因此,我的用例是能够在用户靠近(~1 公里)某个位置时发出警报。我是否应该跳过重要的位置更新并自己每 10 分钟左右轮询一次位置管理器?

谢谢,
泰贾。

最佳答案

考虑使用区域监控 API。这是在支持 iOS 4 多任务处理的同时完成您锁定的任务的唯一方法。但请注意,它有点不稳定,特别是如果您想监视许多区域。

如果您只想知道用户何时靠近特定位置,我会避免使用重大位置更改 API。

关于iphone - 后台位置跟踪: iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5614557/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com