【发布时间】:2013-09-26 09:03:37
【问题描述】:
我的项目正在使用 CLLocationManager 对象,通过以下方式接收更新: locationManager:didUpdateToLocations:
即使我的应用在后台,我也想要这些更新。因此,在 info.plist 中,我将“必需的后台模式”列表设置为应用程序寄存器以进行位置更新。
但我的测试表明它在后台状态下没有收到更新。
但是,我不确定我对背景状态/暂停状态的理解是否正确。 这就是我认为它的工作原理:
After the home button is pressed, the app enters background mode for 5 seconds,
and then enter suspended state.
我想这就是它不起作用的原因。但是如果将 info.plist 设置为 ""app registers for location updates" 并不能阻止应用程序达到挂起状态,那么我该如何实现呢?
按主页按钮和按锁定按钮有什么区别(如果有)?我的意思是在国家层面。
我已阅读本指南的相关部分:http://www.raywenderlich.com/29948/backgrounding-for-ios
我还是 IOS 新手,所以我可能忽略了一些东西。
【问题讨论】: