NathanaelA / nativescript-permissions

Wraps up the entire Android 6 permissions system in a easy to use plugin.
MIT License
46 stars 22 forks source link

Not working for me since our NS 3.0 upgrade #27

Closed randy-johnson closed 7 years ago

randy-johnson commented 7 years ago

This plugin doesn't seem to be working for me since we upgraded to NS 3.0. I never see the popups and it defaults to catch function automatically.

NathanaelA commented 7 years ago

I can't think of anything that shouldn't work in 3.0...

rolaru commented 7 years ago

@randy-johnson, I had the same issue as you did and in my case it was because I was using other plugins that had their own way of requesting permissions. Example: nativescript-geolocation recommends to require permissions using

if (!geolocation.isEnabled()) { geolocation.enableLocationRequest(); }

Once I deleted the above lines and requested the geolocation permissions using only @NathanaelA 's plugin (in my case _android.Manifest.permission.ACCESS_FINELOCATION and _android.Manifest.permission.ACCESS_COARSELOCATION) everything worked perfect.

NathanaelA commented 7 years ago

@randy-johnson - As a follow up; I've been using this plugin in several apps that are 3.x; no issues. There are two reasons why I've seen this fail:

  1. You forgot to put in the permission you will be requesting in the Manifest, Event Android O requires this.
  2. You declined the permission before, and so the OS remembers your setting. To "undo" you can either go into security on your device and RESET all security; or sometimes just uninstalling the app fully from the phone will work
  3. What rolaru mentions, if another plugin overwrites the permission handler; then my permission handler won't see the permissions.