I'm trying to set the string that is shown when my app requests location authorization. I've tried setting all four possible keys in Info.plist:
NSLocationUsageDescription
NSLocationAlwaysUsageDescription
NSLocationWhenInUseUsageDescription
NSLocationAlwaysAndWhenInUseUsageDescription
I've also tried setting the locationManager.purpose
string which is deprecated in iOS, but not macOS. None of these methods cause the string to appear in the alert when the app requests authorization.
I'm using this code to request access:
var locationManager = CLLocationManager()
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
switch status {
case .notDetermined:
locationManager.startUpdatingLocation()
locationManager.stopUpdatingLocation()
default: break
}
}
Here's a screenshot of the alert:
Calendar.app is able to customize the alert: