我已使用NSLocationAlwaysUsageDescription设置了info.plist,该应用程序在后台运行。大约15分钟后,它停止了。在“应用程序功能”部分启用了后台模式和位置服务
其他一切似乎都工作正常。
- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"Entered Background");
self.appdelegatelocationManager = [[CLLocationManager alloc]init];
self.appdelegatelocationManager.delegate = self;
[self.appdelegatelocationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[self.appdelegatelocationManager setDistanceFilter:kCLDistanceFilterNone];
[self.appdelegatelocationManager setPausesLocationUpdatesAutomatically:NO];
[self.appdelegatelocationManager startUpdatingLocation];
}
一旦我再次进入该应用程序并再次进入后台,它将再次工作15分钟。
请帮忙!
最佳答案
关于ios - 后台CLLocationManager在15分钟后停止更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35283951/