Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在后台保持 CLLocation 更新。我相信您需要在 Application 委托中注册应用程序才能执行此操作,但我在任何地方都找不到对此的引用?
以下是相关文档的链接:
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20
特别是,请参阅本段:
应用程序可以声明自己需要持续的后台位置更新。需要在前台和后台定期更新位置的应用程序应将键添加到其 Info.plist 文件中,并将此键的值设置为包含字符串UIBackgroundModes的数组。location此选项适用于提供特定服务(例如导航服务)的应用程序,这些服务涉及让用户始终了解他或她的位置。应用程序文件中密钥的存在Info.plist告诉系统它应该允许应用程序根据需要在后台运行
UIBackgroundModes
location
Info.plist