Location manager stops updating after 1 hour

111 Views Asked by At

According my app requirement, we do tracking on, and its working fine. but problems comes when i enable GPS service on and never moves and place iPhone on desk for 1 hour after that i do journey of 30 minutes but my update location delegate never called this time.below is my code:

locationManager = [[CLLocationManager alloc]init]; 
locationManager.delegate = self;     
locationManager.distanceFilter = 150.0f; 
locationManager.desiredAccuracy = kCLLocationAccuracyBest; 

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")) { 
    setPausesLocationUpdatesAutomatically:NO]; 
}
1

There are 1 best solutions below

0
On

Write this code :

[locationManager startUpdatingLocation];

& write their delegates methods also :

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
   NSMutableString *latString = [NSMutableString stringWithFormat:@"%f",newLocation.coordinate.latitude];

   NSMutableString *lngString = [NSMutableString stringWithFormat:@"%f",newLocation.coordinate.longitude];
}