How to Set the Current Location Usage Description for iOS Apps?

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. We experienced this first hand with the iOS version of the Farmers Market app. Apple reviewers sent us the following message:

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 this feature in the permission modal alert.

To address the problem, we have changed the config.xml file at the root folder of the Cordova project. We 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>

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.