Setting NSLocationWhenInUseUsageDescription value when using cordova-plugin-geolocation

NEW ANSWER:

If using Cordova CLI 6.5.0 or newer and latest version of cordova-plugin-geolocation (>=3.0.0), you should use edit-config tag in the config.xml like this:

<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
    <string>your custom text here</string>
</edit-config>

OLD OUTDATED ANSWER: Fork the github plugin

change the NSLocationWhenInUseUsageDescription with the text you want

<config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
    <string>your custom text here</string>
</config-file>

then remove the original geolocation plugin and install your fork with

cordova plugin add https://github.com/yourUsername/yourGeolocationFork.git