我正在创建一个 iPhone 应用程序,其中 AI 必须在发生重大变化时更新位置。为此我使用了“[locationManager startMonitoringSignificantLocationChanges]”。 我必须在应用程序处于后台时更新位置。所以我在 info.plist 中将所需的背景模式设置为“应用程序注册位置更新”。 我的疑问是: 使用startMonitoringSignificantLocationChanges时是否有必要在info.plist中提供它以进行后台注册?
如果有人有想法,请帮助我... 提前致谢
最佳答案
重大位置更改将自动在后台启动您的应用程序,无需所需的后台模式 key 。仅当您持续监控位置(例如街道导航转弯应用)时,才需要所需的背景模式。
编辑:这包含在 Location Awareness Programming Guide 中,值得一读:
The preferred option is to use the significant location change service to wake your app at appropriate times to handle new events. However, if your app needs to use the standard location service, you can declare your app as needing background location services.
因此,如果您正在使用重要的位置更改服务,它将被唤醒并且您不需要后台模式键。如果您使用的是标准位置服务并且必须在后台运行,那么您需要后台模式键“位置”。
关于ios6 - iPhone 应用程序后台的 GPS 位置更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14495539/