我的 locationManager 设置为在 BG 中工作(allowsBackgroundLocationUpdates + 功能背景模式:已检查位置更新)。
我的 CLLocationManagerDelegate 的
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations
当应用程序在 BG 中时工作正常。
但,
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
当应用程序在 BG 中时不会被调用。当应用程序返回到 FG 时,该方法被调用。
- 我在 iOS 10 上检查了这个。
有任何想法吗?