I have just started to use expo-image-picker but for testing purposes I have denied the camera permissions so many times that I'm not being asked anymore whether I want to allow or deny the permission. I have refreshed, relaunched the app but nothing to do
Sample.js
import {TouchableOpacity} from "react-native";
import React from "react";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
import * as ImagePicker from "expo-image-picker";
const Sample = ({ navigation }) => {
const handleUpload = async () => {
let permissionResult =
await ImagePicker.requestMediaLibraryPermissionsAsync();
console.log(permissionResult);
if (permissionResult.granted === false) {
alert("Camera access required");
return;
}
};
return (
<KeyboardAwareScrollView>
<TouchableOpacity onPress={handleUpload}>
{image && image.url && (
<FontAwesome5
name="camera"
size={20}
color="black"
style={{ marginTop: -20, marginLeft: 200, marginBottom: 30 }}
/>)}
</TouchableOpacity>
</KeyboardAwareScrollView>
);
};
export default Sample ;