I've been using this plugin https://github.com/dpa99c/cordova-diagnostic-plugin for a long time and works fine. Nowadays I'm using framework7, which is awesome. I've got this code to ask for camera permission, which works fine
onDeviceReady: function() {
cordova.plugins.diagnostic.requestCameraAuthorization(
function(status){
console.log("Authorization request for camera use was " + (status == cordova.plugins.diagnostic.permissionStatus.GRANTED ? "granted" : "denied"));
if (myApp.device.ios) {
cordova.plugins.diagnostic.isCameraRollAuthorized(function(authorized){
if (!authorized) {
cordova.plugins.diagnostic.requestCameraRollAuthorization(function(granted){
}, function(error){
console.log("Authorization request for camera roll has error " + error.code + " - "+ err.msg);
});
}
});
}
}, function(error){
console.error("The following error occurred: "+error);
}, false
);
but after allowing the camera to take pictures, my app stays freeze, I can write on input box, but when I click on any button/link nothing happens. I have no console errors and it happens only on iOS. If you restart the app, everything works fine. I also try adding this plugin:
<gap:plugin name="cordova-plugin-ios-camera-permissions" source="npm" >
<variable name="CAMERA_USAGE_DESCRIPTION" value="La aplicacion requiere el permiso para tomar fotografias." />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="La aplicacion requiere el permiso para acceder a la lista de fotografias." />
</gap:plugin>