react-native-qrcode-scanner
react-native-qrcode-scanner copied to clipboard
How to allow the user to activate the camera permissions if he deny it at the first time ?
A want to allow the user to reactivate it camera permission for the app if at the first time he deny the permission
What's happening?
I did't find a way to make this action available for the user like from a button , i can make an action to show the permission dialog to the user with props or method
How can it be reproduced?
allow the user to reactivate the camera permission inside the app with a button event
Build details?
Android version 11 react-native version 0.63.4
` import { Platform, PermissionsAndroid, } from 'react-native'; if (Platform.OS === 'android') { const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.CAMERA, );
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
//user accepted
} else {
//user declined
}
}
`
` import { Platform, PermissionsAndroid, } from 'react-native'; if (Platform.OS === 'android') { const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.CAMERA, );
if (granted === PermissionsAndroid.RESULTS.GRANTED) { //user accepted } else { //user declined } }
`
What we do in "//user accepted" ? Because i tried a few things like making the window of asking permission again, but i cant change the camera to appear again.