I am using Cordova 5.3.3 and the Apache Camera Plugin 1.2.0 on IOS 9. I can succesfully take a picture with the camera however when I try to get a picture from photo library it goes back to camera and I get an error "has no access to assets" in the cordova error callback. I am using the following code.
navigator.camera.getPicture(onSuccess, onFail, {
quality: 75,
destinationType: Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.PHOTOLIBRARY
});
When I check the the application rights I see that it has access to Camera but not Photos. Is that the problem? Doesn't Cordova adds the required features when adding the plugin?
I encountered a similar issue when using
cordova-plugin-camera
on iOS: permission was not being requested to store the photo in the Photos app after taking a photo, so storing it to the Camera Roll was failing.I worked around the issue by using cordova-plugin-diagnostic to ensure authorisation was granted for both Camera and Photos before attempting to take a photo. This also takes care of the edge case where the user revokes access after intially granting it. Based on my implementation and your usage of the camera plugin, you could try something like this: