Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Google Maps to request again for location permissions?

I'm using Google maps in my mobile web app, but it I've noticed that sometimes when maps prompts for location permissions, users accidentally tap on "Deny" instead of "Allow" and they need to reload the page to be correctly located.

Is there a way to, i.e., have some JS call that users can trigger, let's say by tapping a button for example, to change their choice on giving location access permissions or make the browser re-prompt for them?

Thanks in advance for any help :)

like image 246
Gerard Avatar asked Nov 08 '11 16:11

Gerard


1 Answers

This is not possible, If the user opted out the best they can do is to clear their location settings to receive the prompt again. You can't force this, nor I believe should you want or be able to. After all where would it end.

Allow or deny? Are you sure? Sure you're sure? Positive you're sure? Etc..

See: http://support.google.com/gmm/bin/answer.py?hl=en&answer=1250068

The correct way to handle this would be to look for PERMISSION_DENIED and then display a message to your users such as "This application requires the use of location services, please enable them on your device to use this application" or some such.

like image 146
Fraser Avatar answered Oct 22 '22 03:10

Fraser