I added cordova-plugin-android-permissions as told in this page but I cant get it work.
https://github.com/NeoLSN/cordova-plugin-android-permissions.
and in main.js I added this piece of code but I am not sure about it…
I do not see any permission when I run the apk on the device
document.addEventListener('deviceready', function() {
var permissions = cordova.plugins.permissions;
permissions.requestPermission(permissions.CAMERA, success, error);
function error() {
console.warn('Camera permission is not turned on');
}
function success( status ) {
if( !status.hasPermission ) error();
}
console.log('cordova.plugins.permissions is now available');
});
I am not sure but maybe installing plugin is not enough ? Do I need to add permission lines in manifest file but which one ? I see many of them when I search for AndroidManifest.xml, can you help me for this ?