【发布时间】:2016-11-11 05:43:54
【问题描述】:
我正在使用MKMapView 开发应用程序。我想每 3 分钟将位置更新到服务器。现在我可以使用NSTimer 更新位置,但是当应用程序在后台时我无法更新。我搜索了其他堆栈溢出答案,但没有帮助。
我尝试过的:
- 我打开了后台模式并选择了位置更新
-
我将此代码包含在我的视图中确实加载方法:
self.locationManager.allowsBackgroundLocationUpdates = true
接下来我能做什么?有人可以帮我做这个吗?
【问题讨论】:
-
在 Plist UIBackgroundModes = location 中添加此键并点击此链接stackoverflow.com/questions/33385652/…
-
我已将 NSlocationAlwaysUsageDescription 和 NSLocationAlwaysUseinUsageDescription 添加到 plist...这足以与背景一起使用吗???@shrikant Tanwade
-
我已经在视图控制器中编写了所有函数,如何调用这些函数来 appdelegate....@ShrikantTanwade
-
应用程序更新位置的时间是多少?我的意思是时间...
-
3 分钟....@HiteshSurani
标签: ios swift swift2 location mkmapview