async function WriteScoped() {
let dir = await ScopedStorage.openDocumentTree(true);
console.log('DIR', dir);
let text = 'Hello world';
if (dir) {
var result = await ScopedStorage.writeFile(
dir.uri,
'helloworld.txt',
'text/plain',
text,
'utf8',
);
console.log('SCOPED WRITED', result);
}
}
async function ReadScoped() {
let dir = await ScopedStorage.openDocumentTree(true);
console.log('DIR read', dir);
if (dir) {
let result = await ScopedStorage.readFile(
dir.uri + '%2Fhelloworld.txt',
'utf8',
);
console.log('SCOPED READED');
}
}
When use ReadScoped the result is:
Possible Unhandled Promise Rejection
'content://com.android.externalstorage.documents/tree/primary%3ADocuments%2Fhelloworld.txt'is not a file
This is my example code
When use ReadScoped the result is:
also If I use