Skip to content
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

Removed camera permission on Android since it is not required #1974

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RodolfoGS
Copy link
Contributor

Manifest.permission.CAMERA is not required to open the camera and take a picture. So, it could be removed to avoid requesting it to the user.

Also, you need to remove this line from your app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.CAMERA"/>

@1Jesper1
Copy link

Interesting, do you have a source where it is explained? Did you test it by reinstalling the app?

@RodolfoGS
Copy link
Contributor Author

Note: If you are using the camera by invoking an existing camera app, your application does not need to request this permission.

Source: https://developer.android.com/guide/topics/media/camera#manifest

Tested on: Android 13 (device), 11 (simulator), 9 (simulator) and 8.1 (device)
All works perfect, uninstalling and installing again to reset the permissions.

@1Jesper1
Copy link

Thanks for the source. Sounds good!

@1Jesper1
Copy link

Could someone test this?

@RodolfoGS
Copy link
Contributor Author

I'm using in production without issues so far

@1Jesper1
Copy link

1Jesper1 commented Oct 18, 2023

@RodolfoGS I just sounds to good to be true :)
Note: If you are using the camera by invoking an existing camera app, your application does not need to request this permission.
Do you use another camera app?

@RodolfoGS
Copy link
Contributor Author

Try it yourself, just remove the permission from the code and you will see that the camera app is opened and works perfect.

Also, you could try with react-native-image-picker that also do not use the camera permission.

Android
No permissions required (saveToPhotos requires permission check).

Note: This library does not require Manifest.permission.CAMERA, if your app declares as using this permission in manifest then you have to obtain the permission before using launchCamera.

Source: https://github.com/react-native-image-picker/react-native-image-picker#android-1

@1Jesper1
Copy link

@ivpusic Could you check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants