-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nothing happens: openPicker or openCamera #1260
Comments
Works in iPhone X, but Cancel and Choose after taking a photo are not localized. Does not work in Google Pixel 2, Android 10 either, so probably something wrong in the Android implementation or permissions. I have my own permissions handling in my app as it uses camera and mic. Maybe the lib cannot handle this and the callback goes to my code when it should go to the lib. This can be seen in the log line onRequestPermissionsResult: 1. If this is the case, it should be fixed in the lib. |
I changed my code to use requestPermissions from the ReactActivity not from ActivityCompat and removed the onRequestPermissionsResult (using a callback). Now I'm getting the following error even though the camera permission has already been granted: Failed to open camera. [Error: Required permission missing] |
BTW. Why is WRITE_EXTERNAL_STORAGE always requested? is it really required to have a WRITE access to the external storage to get images from the gallery or camera? |
I had to request the WRITE_EXTERNAL_STORAGE permission myself to get it working. Still really don't understand why this is needed for just using the camera and why it needs to be WRITE, not READ? |
I suspect it has to do with the compression this library tries to do. It compresses any image you choose, regardless of whether it came from the camera or the file system, and writes it to disk and gives you its URI. |
But I only need a base64 version. Don't know if that can be done in memory. |
The big question, however is, why do I need to request the permissions and the lib's permission request does not work? |
One more problem is that cancelling image selection throws an error. Am I supposed to compare the error description to "User cancelled image selection". I'm sure there could be a better way. Error: User cancelled image selection] |
With Pixel 3, Android 10 I get this even when the user has given both READ and WRITE permissions. This does not happen in Samsung S8 and Android 9.
|
Looks like the lib is not compatible with Android 10 and a workaround in the manifest is needed. |
I'm also seeing this issue manifest itself on Android 10.
|
android:requestLegacyExternalStorage is just a workaround. Unless checking the permissions are fixed, this lib will stop working in the future. |
I can confirm that's fixed, I deleted Thanks so much! |
Version
Tell us which versions you are using:
Platform
Tell us to which platform this issue is related
Expected behaviour
Open gallery or camera
Actual behaviour
Nothing happens.
Steps to reproduce
OR
Attachments
The text was updated successfully, but these errors were encountered: