mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
6.89k stars 1.02k forks source link

🐛 Android's getCameraPermissionStatus and getLocationPermissionStatus always returned 'denied' on a fresh install of the app #2946

Open tomtargosz opened 3 weeks ago

tomtargosz commented 3 weeks ago

What's happening?

On Android, when an app is freshly installed getCameraPermissionStatus and getLocationPermissionStatus always returned 'denied' when they should be returning 'not-determined'. If after installing the app you go into the settings for the app and turn camera or location permissions on and then off, and then open the app the methods will return 'not-determined' as expected. This is not happening on iOS. I noticed this issue that mentions the same thing but I don't believe the docs were updated.

Reproduceable Code

console.log(Camera.getCameraPermissionStatus())
console.log(Camera.getLocationPermissionStatus())

Relevant log output

-

Camera Device

-

Device

Pixel 7 (Android 14)

VisionCamera Version

4.1.0

Can you reproduce this issue in the VisionCamera Example app?

Yes, I can reproduce the same issue in the Example app here

Additional information

giuliobracci commented 3 weeks ago

Hi @tomtargosz I'll suggest you to take a look at react-native-permissions. They have a great README explaining the permissions flow for Android. @mrousavy I can update the docs for Android you're cool with it