App Store Connection reviewers informed me that my build is in violation of the below rule:
Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage
We noticed that your app requests the user’s consent to access their location but does not clarify the use of the location in the applicable purpose string.
...even though I have included the following key value pair in my App's Info.plist:
Privacy - Location When In Use Usage Description: Access to location while the app is in use is required initialize your map feed.
...and I am therefore unable to replicate the issue in the screenshot they shared with me below:
Here is the dialogue I have always seen on the same Device (iPad) iOS 13.3:
My understanding of Apple's docs is that I only need NSLocationWhenInUseUsageDescription
as my application only requires access to a user's location when in the foreground.
Has anyone encountered a similar issue before or have an idea what the source of it is? Many thanks!
Edit: Below is the code governing this experience.
func requestLocationAuthorization(completion: (() -> Void)?) {
let locationManagerAuthorizationStatus: CLAuthorizationStatus = CLLocationManager.authorizationStatus()
let appName = Bundle.main.infoDictionary![kCFBundleNameKey as String] as! String
switch locationManagerAuthorizationStatus {
case .notDetermined:
LNTLocationManager.sharedInstance.requestAuthorization()
case .denied:
let alertString = "To initialize your map feed to your location, enable " + appName + " to use your location while using the app."
presentSettingsAlert(with: alertString, completion: nil)
default:
break
}
completion?()
return
}
In the case where I don't enable location access, I always see the below prompt, not the one that the Reviewers experience:
The dialog they are displaying is what appears from the system the first time you say startUpdatingLocation
at a time when locationServicesEnabled
is false
. It has nothing to do with the denied
alert that you are putting up.
Note that this has nothing to do with user authorization! It has to do with location services being turned off as a whole. Apple, while testing, checks for that circumstance. It looks like your app doesn't.
To prevent the system dialog from appearing, always check whether locationServicesEnabled
is true
, and if it isn't, go no further.
(However, having said that, the message coming to you from Apple is incorrect if they think that the dialog they show is supposed to include your usage description. It isn't. It always looks the way they show it. You might want to write back and tell them that. They might have some people working for them right now who don't know what they're doing.)