Closed somasekharkakarla closed 2 years ago
@somasekharkakarla to read/write you need to first call openDocumentTree
and select the directory where files should be stored/read from. Then use the uri returned to create files.
Then you can use other functions.
@ammarahm-ed can't i create like external directory, with out opening the document tree?
No you cannot. You have to atleast call openDocumentTree
and persist the uri. Then later if you want to reuse the same uri, call getPersistedUriPermissions
and save/read file. That's how scoped storage works on android.
First time
let file = await ScopedStorage.openDocumentTree(true);
await ScopedStorage.writeFile(file.uri,"myfile.png");
Later
let uri = await ScopedStorage.getPersistedUriPermissions();
await ScopedStorage.writeFile(uri,"myfile.png");
Hi, I am using scoped library. I am unable create file. It say you have no permission to create. Can you please how can I call permission. If possible please create a video tutorial on this.