Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Crash on android after getting premissions #377

Open
Gurin-Andrew opened this issue Mar 30, 2022 · 0 comments
Open

Crash on android after getting premissions #377

Gurin-Andrew opened this issue Mar 30, 2022 · 0 comments

Comments

@Gurin-Andrew
Copy link

Hi i'm new at RN and react, and got issue with my app, after first installation when u need to give premissions for camera, after pressing OK button on permissionDialogMessage, i got crash application, anyone got same issue?
part of code
`export const QRScannerLogInMoblieScreen: React.FC = ({
navigation,
route,
}) => {
const {type} = route.params;

const [flashModeStatus, setFlashModeStatus] = useState(false);
const [permissionStatus, setPermissionStatus] = useState(false);
const permissions =
Platform.OS === 'ios'
? [PERMISSIONS.IOS.CAMERA]
: [PERMISSIONS.ANDROID.CAMERA];
useEffect(() => {
(async function checkPermission() {
const status = await PermissionsService.check(permissions);
setPermissionStatus(status);
})();
}, []);
....
return (
<QRCodeScanner
cameraStyle={styles.containerCamera}
onRead={onQrRead}
permissionDialogTitle={t.qrCameraPermissionTitle}
permissionDialogMessage={t.qrCameraPermissionMessage}
showMarker={true}
checkAndroid6Permissions={true}
bottomContent={permissionStatus ? : undefined}
cameraProps={{
flashMode: flashModeStatus
? RNCamera.Constants.FlashMode.torch
: RNCamera.Constants.FlashMode.off,
}}
/>

`

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

No branches or pull requests

1 participant