Ask for geolocation permission again, if it was denied

cordova, geolocation, javascript, jquery

Solution

You can't.

The only thing you can do is to display the instructions to reactivate the location sharing in his browser's settings (https://support.google.com/chrome/answer/142065?hl=en).

Problem

I'm building an app through phonegap, with a geolocation button. If a user denies permission for geolocation the first time, how can I ask for permission again, when they click the geolocation button again? My code structure at the moment is: ``` function getLocation() { if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition, positionError); } else { hideLoadingDiv() showError('Geolocation is not supported by this device') } } function positionError() { hideLoadingDiv() showError('Geolocation is not enabled. Please enable to use this feature') } ```

Original source