From 67c72c941ab783cf5e98ff1aeaf2360b8c1a841a Mon Sep 17 00:00:00 2001 From: analuizaff Date: Mon, 4 Jan 2021 17:54:02 -0300 Subject: [PATCH] trying to fix ios problem with permissions --- src/app/components/ImageInput.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/components/ImageInput.js b/src/app/components/ImageInput.js index 643017a..05ad131 100644 --- a/src/app/components/ImageInput.js +++ b/src/app/components/ImageInput.js @@ -16,7 +16,7 @@ import colors from "../config/colors"; function ImageInput({ imageUri, onChangeImage }) { useEffect(() => { requestPermission(); - requestPermissionCamera(); + //requestPermissionCamera(); }, []); const [modalVisible, setModalVisible] = useState(false); @@ -26,7 +26,10 @@ function ImageInput({ imageUri, onChangeImage }) { }; const requestPermissionCamera = async () => { const { granted } = await ImagePicker.requestCameraPermissionsAsync(); - if (!granted) alert("Você precisa habilitar permissão para acessar a câmera."); + if(granted) { + launchCamera(); + } + else if (!granted) alert("Você precisa habilitar permissão para acessar a câmera."); }; const handlePress = () => { @@ -91,7 +94,7 @@ function ImageInput({ imageUri, onChangeImage }) { Selecione uma imagem - + Câmera