ammarahm-ed / react-native-scoped-storage

MIT License
59 stars 10 forks source link

Getting access denied error. #20

Closed niyasc closed 2 years ago

niyasc commented 2 years ago

I'm trying to list the file names from a particular directory using the listFiles method. It is giving no permission error.

Error message

/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses do not have permission to read/write. Is there any other prerequisite I need to do to get the access?

niyasc commented 2 years ago

Just noticed the steps in https://github.com/ammarahm-ed/react-native-scoped-storage/issues/12. Will check and confirm if it is working. It should be in the README itself I think.

brunofariasd commented 2 years ago

Just noticed the steps in #12. Will check and confirm if it is working. It should be in the README itself I think.

Did it work for you? I have the same problem here.

ammarahm-ed commented 2 years ago

Just noticed the steps in #12. Will check and confirm if it is working. It should be in the README itself I think.

Did it work for you? I have the same problem here.

@brunofariasd it works, i am using this lib in a production app.

brunofariasd commented 2 years ago

Just noticed the steps in #12. Will check and confirm if it is working. It should be in the README itself I think.

Did it work for you? I have the same problem here.

@brunofariasd it works, i am using this lib in a production app.

Hello thx for this awesome lib, but can i use the absolute path example: /storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses,

or do i have to use the uri returned from the function openDocumentTree?

I trying list files using RN.Fetch.Blob with path above and i get array empty.

brunofariasd commented 2 years ago

When I try read files with RNFetchBlob.lstat, i get this error:

[Error: failed to stat path **/storage/emulated/0/Android/data/com.wpp.status_saver/files**/Android/media/com.whatsapp/Whatsapp/Media/.Statuses

even i choosing the correct path with openDocumentTree (/Android/media/com.whatsapp/Whatsapp/Media/.Statuses)

URI {"lastModified": 1641563384000, "name": ".Statuses", "path": "/storage/emulated/0/Android/media/com.whatsapp/Whatsapp/Media/.Statuses", "type": "directory", "uri": "content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsapp%2FMedia%2F.Statuses"}