Camera API (Android): denying permissions for Photos/Video does nothing and still works! #6367
-
I'm seriously puzzled by this, all of a sudden denying permissions to Photos and Video gallery doesn't do anything, and the gallery still opens, no errors thrown! I can even see the permissions returned as 'denied' but gallery still opens:
Using: Tested on S8 (Android 9) and S23 (Android 13) with the same results! Here's a sample code pretty much directly from their demo app: const pickImagesFromGallery = async () => {
try {
const images = await Camera.pickImages({
quality: 80,
width: 1024,
});
for (const image of images.photos) {
const fileName = new Date().getTime() + ".jpeg";
const savedFileImage = await savePicture(image, fileName);
photos.value = [savedFileImage, ...photos.value];
}
} catch (e) {
// This should throw an error if user denied permissions but we never get here
console.log(e);
}
}
}; The other Camera API stuff with taking camera pictures ( Before submitting a bug I wanted to see if anyone has been experiencing this or am I just tripping? Edit: I see from this Android documentation:
So it seems like runtime permissions are being granted for Additionally, if all I use is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The permission is needed for some devices and/or some gallery apps, it's impossible to know which devices or apps, so we request the permission but still proceed even if rejected, and in case it's one of those devices that require the permission and getting the image fails we return a permission error. |
Beta Was this translation helpful? Give feedback.
The permission is needed for some devices and/or some gallery apps, it's impossible to know which devices or apps, so we request the permission but still proceed even if rejected, and in case it's one of those devices that require the permission and getting the image fails we return a permission error.