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

Permissions catching error when trying to use camera or video recorder #25

Closed haiderghaleb closed 6 years ago

haiderghaleb commented 7 years ago

Hello, I'm trying to use videorecorder plugin which has your dependency.

I tracked down the issue that the permissions are not being granted and catching error

I made sure that in the Manifest I gave all the permissions needed but when I'm logging out the error this is what I'm getting

JS: === dump(): dumping members ===
JS: {
JS:     "nativeException": {
JS:         "constructor": "constructor()function () { [native code] }"
JS:     }
JS: }
JS: === dump(): dumping function and properties names ===
JS: === dump(): finished ===
JS: Oops, I'm so sad, I was only granted 0 of 4 permissions!
JS: === dump(): dumping members ===
JS: {
JS:     "event": "camera permission needed"
JS: }
JS: === dump(): dumping function and properties names ===
JS: === dump(): finished ===

Do you think we can fix this issue?

NathanaelA commented 7 years ago

You need to make sure you put the permissions you need ALSO in the android manifest. If you don't have the permission in your manifest; the ability to get permissions at run time will fail and will be rejected. (This is a google requirement, not something we did).

That error message above is not something that the plugin throws.

Demo VideoRecorder has the manifest permissions here: https://github.com/triniwiz/nativescript-videorecorder/blob/master/demo/app/App_Resources/Android/AndroidManifest.xml#L23