ammarahm-ed / react-native-scoped-storage

MIT License
59 stars 10 forks source link

How do I get a uri for application folder that the system provides? #18

Closed CostachescuCristinel closed 2 years ago

CostachescuCristinel commented 2 years ago

The APIs in this lib require uris to directories in order to write files. But there is no indication where to get any user folder uris, such as Documents, Downloads, or even an App directory where to write cache files.

Where can I get those? I am looking for something similar to Expo's FileSystem.cacheDirectory.

ammarahm-ed commented 2 years ago

This is different than usual file management libraries. To get a directory, you need to call openDocumentTree and do operations on that uri. The user selects the directory. Then you can persist the permissions and keep using it.

CostachescuCristinel commented 2 years ago

So, there is no way to write some application cache files anywhere without asking the user to select a folder?

ammarahm-ed commented 2 years ago

@CostachescuCristinel No. That is how scoped storage works. You can't publish apps to playstore with all files access from API 30 onwards.