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

#requestPermissions #3

Closed christocracy closed 8 years ago

christocracy commented 8 years ago

There is a mechanism for requesting multiple permissions simultaneously, [#requestPermissions](https://developer.android.com/reference/android/support/v4/app/ActivityCompat.html#requestPermissions%28android.app.Activity, java.lang.String[], int%29), in addition to the singular #requestPermission.

This allows one to request, for example, both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION simultaneously.

NathanaelA commented 8 years ago

The code has been enhanced to support passing an array of permissions. ;-) If you get the granted promise ran, then all perms were granted. If you get the failed promise, then you might have been granted some of them and you can check which ones were granted/failed in the object you get back.

{
"contact": true,
"camera": false
}

would mean that you didn't get the camera permission.