I am using following code for location-
self.locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy=500;
locationManager.distanceFilter=kCLLocationAccuracyKilometer;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([locationManager respondsToSelector:@selector(requestAlwaysAuthorization)])
{
[locationManager requestAlwaysAuthorization];
}
#else
#endif
[locationManager startUpdatingLocation];
//Disable auto location pause in background
if ([self.locationManager respondsToSelector:@selector(pausesLocationUpdatesAutomatically)])
{
self.locationManager.pausesLocationUpdatesAutomatically = NO;
}
And in my plist file I used "App registers for location updates" for "Required background modes". But apple rejected my application and says you have to use real time location updates if you are using location in background.
Please let me know what I need to use if I want to use location in background with distancefilter.