我使用CLLocationManager及其委托
跟踪位置_locationManager = [ CLLocationManager new ];
_locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
_locationManager.allowsBackgroundLocationUpdates = true;
_locationManager.pausesLocationUpdatesAutomatically = false;
如何在App关闭时更新代码以跟踪位置。应用程序如何跟踪位置并在我想要的时候发送本地通知。
答案 0 :(得分:0)
您可以通过在info.plist文件中添加以下密钥来请求您的应用在后台模式下运行。
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
希望这有帮助。