我使用位置更新在后台模式上连续点击服务器API。它运行良好,但每天都会收集过多的移动数据。有没有办法保存移动数据?
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
self.locationManager.pausesLocationUpdatesAutomatically = NO;
[self.locationManager requestAlwaysAuthorization];
[self.locationManager startMonitoringSignificantLocationChanges];
if ([self.locationManager respondsToSelector:@selector(setAllowsBackgroundLocationUpdates:)])
{
[self.locationManager setAllowsBackgroundLocationUpdates:YES];
}
[self.locationManager startUpdatingLocation];
- (void) locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations
{
[self invokeAPIWithTimerToUpdateUserLocationOnServer];
}