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

Issue with android.Manifest.permission.READ_CONTACTS since 2.2.0 NativeScript upgrade #9

Closed bnussey closed 8 years ago

bnussey commented 8 years ago

Hey Nathanael,

I've been getting great use of your plugin, thanks for your hard work on it. Unfortunately since upgrading to 2.2.0 I am now getting an issue with android.Manifest.permission.READ_CONTACTS

The code below results in this error message: {"android.permission.READ_CONTACTS":false}

let perm = permissions.requestPermission(android.Manifest.permission.READ_CONTACTS,
                'Please click allow to fetch contacts from your phone');
            perm.then(() => {
                this.getAllContacts();
            }, (err) => {
                console.log("Error: " + JSON.stringify(err));
            })

Let me know if you need any other details, hope this wasn't a silly mistake on my part.

NathanaelA commented 8 years ago

I'll take a look at the sample app and verify it works with v2.2.0; it is possible something broke...

bnussey commented 8 years ago

Awesome thanks @NathanaelA sorry spelt your name wrong originally, its been a long day.

NathanaelA commented 8 years ago

I'm using v1.1.2 of the plugin

I just tested my demo on 4.4, 5.1 and 6.0 emulators using NS 2.2.0 and it worked properly. Now on the 6.0 device if you deny the permission twice (if I recall correctly) you might have to go to settings->security->app permissions and then reset the app permissions; otherwise 6.0 will remember your choice and ALWAYS deny it without giving you the opportunity to answer.

In addition you also have to have to list these permissions in the application manifest...

bnussey commented 8 years ago

Hey @NathanaelA adding it to the manifest did the trick.. weird that it was working before the upgrade, thanks for your help!