On IOS the first time a user who has not previously given permission for their camera the screen shows black screen. If the user closes the app and returns, the camera works fine.
A loading screen is shown before the permissions have been granted.
Can anyone help?
[black screen camera][1]
const __startCamera = async () => {
setCameraState({
...cameraState,
previewVisible: false,
showConnectionError: false,
showConfirmPage: false,
showConfirmSuccess: false,
capturedImage: undefined,
});
const { status } = await Camera.requestCameraPermissionsAsync();
console.log(status);
if (status === "granted") {
console.log("granted", status);
setCameraState({
...cameraState,
isLoading: false,
});
} else {
Alert.alert(t("camera.cameraPermissionError"));
setCameraState({
...cameraState,
isLoading: true,
});
navigation.navigate("Home");
}
[1]: https://i.stack.imgur.com/dl68S.png