Android 11 is more restrictive than older versions when providing access to user files.
The goal is to improve security, and that is ok, but it breaks some apps.
To fix that, we can add <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> to the app manifest. That allows the user to go to the app settings and turn on the option (allow management of all files):

But this is not enough by itself, as users won't do that if they are not asked for it. They will only see an app that does not work.
At this moment, there is literally no mention to this particular permission on the React Native repository.
Is there any solution to this? We should be able to check whether that permission has been given so we can act accordingly, and we should be able to ask the user to grant the permission.
you can use this library: https://www.npmjs.com/package/manage-external-storage
// check if can manage
checkManagePermission().then((isManagePermitted) => {
console.log(isManagePermitted);
});
// request rights to manage
requestManagePermission().then((isManagePermitted) => {
console.log(isManagePermitted);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With