I am trying to use Expo-image-picker with a react-native application. Here is my code:
const openCamera = async () => {
const permissionResult = await ImagePicker.requestCameraPermissionsAsync();
if (permissionResult.granted === false) {
alert("You've refused to allow this app to access your photos!");
return;
}
const result = await ImagePicker.launchCameraAsync();
if (!result.cancelled) {
uploadImage(result.uri)
}
}
Every time I try to use it it immediately jumps to the alert without prompting the user to give the camera permission. I've tried several different hooks and they all seem to not work. If anyone has a working example I'd be greatly appreciative.