Search code examples
iosmkmapviewlocation-services

iOS app rejected - Your app enables the display of nearby users' locations on a map, but does not have the required privacy precautions in place


My iOS app rejected from apple due to following reason :-

Your app enables the display of nearby users' locations on a map, but does not have the required privacy precautions in place.

And they are sharing this screenshot of my app with rejection message.

enter image description here

In my app, I am using user’s location for showing near by events on the Map. Also I have enabled option showing user’s location on the Map.

I am using following code for setting up location services into my app.

//Declarting objects in .h file
CLGeocoder *geocoder;
CLPlacemark *placemark;

@property (nonatomic,retain) CLLocationManager *locationManager;

//Calling this method from viewDidLoad for setup location services..
-(void)getUserCurrentLocation
{
    geocoder = [[CLGeocoder alloc] init];

    self.locationManager=[[CLLocationManager alloc]init];
    self.locationManager.delegate=self;
    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    _locationManager.distanceFilter=kCLDistanceFilterNone;

    if ([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])
    {
        [_locationManager requestWhenInUseAuthorization];
    }

    [self.locationManager startUpdatingLocation];
}

-(void)StopUpdateLOcation
{
    if([CLLocationManager locationServicesEnabled])
    {
        [self.locationManager stopUpdatingLocation];
    }
}

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
    CLLocation *currentLocation = newLocation;

    if (currentLocation != nil)
    {

        //Saving location
        [USERDEFAULT setValue:[NSNumber numberWithFloat:currentLocation.coordinate.latitude] forKey:@"CurrentLocationLatitude"];
        [USERDEFAULT setValue:[NSNumber numberWithFloat:currentLocation.coordinate.longitude] forKey:@"CurrentLocationLongitude"];

       //Here reverseGeocodeLocation method for fetching address from location

        [self StopUpdateLOcation];
    }
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
    NSLog(@"didFailWithError: %@", error);
}

Also I have added property “Privacy - Location When In Use Usage Description” with proper message. Also I have disabled the location service when got the location.

Not sure, why they are rejecting app. Did I miss something.?

How can I resolved this issue.?

Any help would be appreciated.


Solution

  • Finally, Got the proper solution for this. Thanks @Anbu.kartik for helping to findout this solution.

    I have enabled the option for showing user’s location on the MAP. but didn’t wrote the failure delegate methods for handling, if user’s location not found.

    So I write following delegate methods and send an app for approval again. And the app is approved by apple.

    - (void)mapView:(MKMapView *)mapView didFailToLocateUserWithError:(NSError *)error{
        NSLog(@"didFailToLocateUserWithError %@", error.description);
    }
    
    - (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error{
        NSLog(@"mapViewDidFailLoadingMap %@", error.description);
    }
    

    So we must have to write failure delegates for handling errors for all the functionalities. So never happens rejection of app related this type of issues.

    Hope, this is what you're looking for. Any concern get back to me. :)