I'll investigate some more.
I've investigated some more. The Stack Overflow post is correct, first request FINE and iff that is given, request BACKGROUND. The latter will open the apps location settings page, iff the app also have the permission from #4 in the manifest.
So there seems to be a
happy path to gettin "Always allow", which is absolutely great.
There is also some sad issues to handle, that I don't know the best solution for yet. The worst seem to be the case where the user doesn't select anything else than Deny. If they do so twice, the request doesn't even display anymore. As far as I can tell, there are only two ways to solve this:
- Ask the user to manually go into app settings, to location, and pick "Always allow" - something many users would find way too complicated...
- Ask the user to uninstall the app and install it again and this time follow the happy path - not much good can come from asking the user to uninstall your app...
The best workaround I can think of at the moment is if we could find an intent to open the location settings. We could then create a user interface with "You need to do this to make the app work, please click here to open the settings". But I've searched the interwebs, and I'm not able to find that intent, so I'm not hopeful it exists.
UPDATE. The best I've been able to find is opening the main settings page for the app:
Dim in1 As Intent
in1.Initialize("android.settings.APPLICATION_DETAILS_SETTINGS", "package:" & Application.PackageName)
StartActivity(in1)
Before doing so, one should probably instruct the user how to navigate to
Permissions and then
Location