【发布时间】:2014-07-12 15:46:16
【问题描述】:
我正在构建一个在后台启用位置更新的应用程序,为此我使用CLLocationManager 的实例和以下代码:
self.coreLocationManager.desiredAccuracy = kCLLocationAccuracyBest;
[self.coreLocationManager startMonitoringSignificantLocationChanges];
我实现了它的委托回调- (void)locationManager:(CLLocationManager *)locationManager didUpdateLocations:(NSArray *)locations,在其中我触发了一个对 Google 的网络请求,以便对坐标进行反向地理编码并检索该位置的地址。
如果应用程序在前台,这确实工作得很好,但在后台它似乎不起作用。我也很难调试它以进行测试,因为当应用程序在后台时我无法访问日志(所以我使用 Mixpanel,一个分析框架将位置更新捕获为事件,但是显然它们也不起作用)。
【问题讨论】:
标签: ios google-maps ios7 location cllocationmanager