I got my app rejected because
We found that your app uses a background mode but does not include functionality that requires that mode to run persistently. This behavior is not in compliance with the App Store Review Guidelines.
We noticed your app declares support for location in the UIBackgroundModes key in your Info.plist but does not include features that require persistent location.
I need to track the user location in the background in order to fire a notification if the user is near one of his/her pictures on the application. That's why I used background mode key on my .plist
This how I initialize my locationManager
_locationManager = [[CLLocationManager alloc] init];
_locationManager.delegate = self;
_locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
_locationManager.distanceFilter = 1000; // Will update evert 1 KM.
_locationManager.activityType = CLActivityTypeFitness;
_locationManager.pausesLocationUpdatesAutomatically = YES;
[_locationManager startUpdatingLocation];
And I'm using didUpdateToLocation to receive the location on the background.
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
if (_currentLocation == nil){
self.currentLocation = newLocation;
}else{
if([self.currentLocation distanceFromLocation:newLocation]){
[self getNearPicturesMethod:newLocation];
}
}
}
They pointed to me that I should use "startMonitoringSignificantLocationChanges" but still if I remove the background key (what they want) the app won't receive location updates anymore if it's on the foreground, they present only if the user opens it and that doesn't work for me.
PS. I read related questions but nobody seemed to fix this problem or to provide a workaround.