I am working on a web-app that requires the user's geo-location. I'm having trouble deciding on the best way to ask for that permission. I have it narrowed down to two different flows.
1- Ask for forgiveness.
When the user clicks the button for the feature that requires the location, the app requests location from the browser, the browser shows it's popup asking the user to grant or deny permission. Since this is the browser's pop-up (out of my control), no information is provided, only grant or deny. If the user grants permission, all is good and we move on. But, if the user denies the request, then I would show a dialog box explaining why the location is needed and ask again nicely that the user enable the browser's location feature.
2- Ask for permission.
When the user clicks the button for the feature that requires the location, the app shows the dialog box explaining why the location is required, and tells the user to watch for the browser pop-up and to be sure to grant permission, or provide them with the opportunity to deny, in which case the app would never send the request for location to the browser.
Problems with option 1.
Enabling location after having denied it, is really complicated on some browsers, Safari on iOS in particular and I haven't tested it on Android myself but there too I think it's a problem. Also Opera requires a page refresh for the change to take effect. So bottom line, it's a big ask from the user, and it would require explaining which would need a like full-blown tutorial.
Benefits of option 1.
I think that most users will intuitively understand the need for the location data and thus would enable it right away with the browser pop-up and very little hassle. Once enabled, it remains enabled and future clicks on the feature will no longer require any intervention.
Problems with option 2.
There appears to be no reliable way to determine whether or not access is granted to browser location without asking for permission. Thus you would need to ask for permission every time, whether or not access has been previously granted. There is a workaround, and that would be to save to state (eg: localstorage) the result of the deny / allow request from the dialog box.
2nd problem is that when you ask the user to allow in the dialog box, it will close and will be followed with the browser's pop-up that again needs to be allowed. This double allowing may be confusing for some people. "I just clicked Allow, why do I need to allow again?".
3rd problem, some user may still unknowingly deny access, for example as a result of the 2nd problem. In which case we are facing the same issues as in option 1, trying to enable location after having denied it.
Benefit of option 2.
The user sees the explanation for the need for the location data upfront, and knows what to expect.
What option would you choose? Any other ideas.