Providing a clear location usage description is critical to have your iOS app approved. With the default settings of the Apache Cordova location plugin
cordova-plugin-geolocation, your app is likely to be rejected by Apple. I experienced this first hand with the iOS version of the Farmers Market app. Apple reviewers sent me the following message:
We noticed that your app requests the user’s consent to access their location, but does not clarify the use of this feature in the permission modal alert.
To address the problem, I had to change the
config.xml file at the root folder of the Cordova project. I have added the following to customize the location permission request on iOS. It sets the value of the entry
Privacy - Location When In Use Usage Description in the
plist of the xCode project.
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription"> <string>Farmers Market wants to get your location to find nearby markets. Your location is kept secrete in your smartphone.</string> </edit-config>