-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
I encountered this issue so I am writing this just to tell everyone how to fix this permission issue in android
I have added permissions in manifest file
....
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> // worked without this also
...
<application ...
android:requestLegacyExternalStorage="true" // this is needed
....
>
Also don't forget to ask for permission
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
{
title: "Cool Photo App Camera Permission",
message:
"Your app needs permission.",
buttonNeutral: "Ask Me Later",
buttonNegative: "Cancel",
buttonPositive: "OK"
}
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
return true;
} else {
console.log("Camera permission denied");
return false;
}
} catch (err) {
console.warn(err);
return false;
}wmonecke, roaringUnicorn, eatnug, mthuong, bluearth and 18 morematiullah-netlinks, PatrissolJuns, drtechie, GitKat, FLiotta and 1 moreShivamJoker, wmonecke, fabyeah, justsomeofl, eatnug and 8 moreroaringUnicorn, eatnug, mthuong, matiullah-netlinks, PatrissolJuns and 4 more
Metadata
Metadata
Assignees
Labels
No labels