Ok, I have a naive solution. You can use NSTimer to force the CLLocationManger instance to update its current location every 15 minutes or the time you want to update periodically.
, :
, , , viewDidLoad .
- (void)startStandardUpdates
{
if (nil == locationManager){
locationManager = [[CLLocationManager alloc] init];
}
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:900 target:self selector:@selector(updateUserLocation) userInfo:nil repeats:YES];
[timer fire];
}
-, updateUserLocation:
-(void)updateUserLocation{
[self.locationManager startUpdatingLocation];
}
, , . 15 .:
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations{
CLLocation *userLocation = [locations objectAtIndex:0];
CLLocationCoordinate2D userLocationCoordinate = userLocation.coordinate;
[manager stopUpdatingLocation];
}