Is it possible to grant Nearby API permissions from phone settings?
Read on for more context if needed :)
When an app targeting API level 23 or higher is installed on a device running API level 23 or higher, access to actions that required dangerous permissions can be granted or revoked by the user in two different ways:
requestPermissions
result in the user being shown a prompt;In particular, a user who has denied a permission that has been requested (at least) twice via mechanism #1, and who has checked 'Never ask again' in the most recently-displayed prompt:
can still choose to grant that permission at a later time using mechanism #2.
When an app wishes to use the Nearby Messages API, a mechanism similar to (but distinct from) #1 can be used to request the necessary permissions at runtime. As far as I can tell, these permissions are not represented within any of the standard dangerous permissions groups.
Just like for typical dangerous permissions, it is possible for a user to instruct an application to 'Never ask again' for the Nearby API permission (example from Pocket Casts; device running API 23):
However, if a user selects this option it would appear to be totally permanent. Here are the listed permissions groups for Pocket Casts immediately after denying access to the Nearby APIs with 'Never ask again' checked:
The only dangerous permissions group present is Storage, and access is still granted. There's no sign of the Nearby API permissions, and I therefore don't see how it is possible to ever grant access to these permissions after reaching this state... (apart from uninstalling and reinstalling the application, which isn't ideal!)
In more recent testing I seem unable to permanently deny the Nearby permission. Even after the first denial, the "Never ask again" checkbox does not appear. I am guessing this was introduced by a change in the Google Play Services version running on my phone. Here's what the permissions dialog looks like now. Note that it includes specific instructions related to locating the Nearby permission setting!
Right-click the individual API or Service to grant permissions. At the upper right of the API Permissions screen, click the Grant Permission icon or the Revoke Permission icon to grant or revoke permission to the user for that API or Service. By default, permission is revoked for all APIs or Services.
Permission is part of the nearby devices group In system settings, the user must enable and disable the Nearby devices permissions as a group; for example, users can't disable Wi-Fi access but keep Bluetooth access enabled for a given app.
As pointed out by Morrison Chang in the comments, Nearby API permissions control is located under Settings -> Google. Here's an animated gif showing how to grant access to the Nearby APIs on an app-by-app basis, starting from the settings screen of a Nexus 6 running Marshmallow:
As a developer, this makes sense to me in hindsight - it's the only way Nearby permissions management could be backported to pre-Marshmallow devices. As a user, though, I definitely found this confusing!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With