甚至我的应用程序也在后台注册位置更新。
在我的代码中:
self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
self.locationManager.distanceFilter = 2500;
而且我没有搬到任何地方。因此,在控制台日志中正好 15 分钟后,我收到了这条消息"Location icon 现在应该处于状态 'Inactive'"。从此时起,我的应用程序不再在后台运行。
它只发生在 iPhone 5 中。
@更新
这是我的代码
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
[self.locationManager setPurpose:@"Enable Location service for \"My App\" to track your"];
self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
/* Notify changes when device has moved x meters.
* Default value is kCLDistanceFilterNone: all movements are reported.
*/
self.locationManager.distanceFilter = 2500;
[self.locationManager startUpdatingLocation];