I have succesfully been able to take a photo inside my app and store it on the phone, but how do I display it?
I tried this static approach but it does not work (Yes
// import
import { PermissionsAndroid } from "react-native";
// function to request permission
requestStoragePermission = async () => {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,
{
title: "Permission title",
message:
"Permission message",
buttonNeutral: "Ask Me Later",
buttonNegative: "Cancel",
buttonPositive: "OK",
}
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log("You can use the EXTERNAL_STORAGE");
} else {
console.log("EXTERNAL_STORAGE permission denied");
}
} catch (err) {
console.warn(err);
}
};