Rejected due to background location mode

| | August 7, 2015

my app update (1.1) was rejected because of this reason:
We found that your app uses a background mode but does not include functionality that requires that mode to run persistently.

But my app still uses the same functionality in version 1.0.

What i do:
On location update i check if the new location is inside a specific region (rectangle):

- (BOOL)locationInRegion: (CLLocation *) lastLocation {
    if ((lastLocation.coordinate.latitude < self.overlayTopLeftCoordinate.latitude && lastLocation.coordinate.latitude > self.overlayBottomLeftCoordinate.latitude) &&
        (lastLocation.coordinate.longitude < self.overlayTopRightCoordinate.longitude && lastLocation.coordinate.longitude > self.overlayTopLeftCoordinate.longitude)) {
        return YES;
    }
    return NO;
}

In Foreground and in background mode if the user is in this region i draw a crumb path on a MKMapView. If not, i do nothing.

Require background modes -> app registers for location updates is in my .plist

What i am doing wrong?

I do not have this information in my description:

Continued use of GPS running in the background can dramatically
decrease battery life.

Can this be the (only) reason?

2 Responses to “Rejected due to background location mode”

  1. There are 2 possible reasons that your app is rejected.

    It is either:-

    a) Your app does not need location update when it is in the background.

    b) Your app does not handle the background location updates properly

    If it is the latter, you will need to handle the location update and also the background tasks when it is in the background. You will need something like this

    - (id)init {
       if (self==[super init]) {
        //Get the share model and also initialize myLocationArray
        self.shareModel = [LocationShareModel sharedModel];
        self.shareModel.myLocationArray = [[NSMutableArray alloc]init];
    
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];
     }
     return self;
    }
    
    -(void)applicationEnterBackground{
      CLLocationManager *locationManager = [LocationTracker sharedLocationManager];
      locationManager.delegate = self;
      locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
      locationManager.distanceFilter = kCLDistanceFilterNone;
      [locationManager startUpdatingLocation];
    
      //Use the BackgroundTaskManager to manage all the background Task
      self.shareModel.bgTask = [BackgroundTaskManager sharedBackgroundTaskManager];
      [self.shareModel.bgTask beginNewBackgroundTask];
    }
    

    The above is only a snippet of the complete solution. I have shared a complete solution that is uploaded to Github and also a blog post on how to continuously get location update in the background for iOS 7 here: Background Location Services not working in iOS 7 .

  2. Yes, if you fail to add following warning text in your app description and you have enabled background-location mode, Apple will reject your app.

    Continued use of GPS running in the background can dramatically decrease battery life.
    

Leave a Reply