我想得到引用,当我们的应用程序在后台运行时,我们如何找出当前的纬度和经度..
如果您有任何建议,请推荐我...
提前致谢。
最佳答案
首先,您需要告诉 iOS 您的应用程序将在后台运行,以检索用户位置。
通过添加 Required background modes
来做到这一点到 info.plist 并将一项设置为 App registers for location updates
刚刚设置了CLLocationManager
开始监视位置变化。
Apple 确实建议您的应用程序仅使用 significant changes
节省电池:http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW6
关于iphone - 应用程序在后台运行时如何获取当前位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7268398/