StorageAccessFramework.createFileAsync() returns weired result ?

Reproducible demo

Summary

const permissions = await StorageAccessFramework.requestDirectoryPermissionsAsync();
let directoryUri = permissions.directoryUri; 
// eg: here directoryUri is "content://com.android.externalstorage.documents/tree/primary%3ADocuments", the value was selected  by the user via ui
const filename = "doc.pdf"
let safUri = await StorageAccessFramework.createFileAsync(directoryUri, filename);

Now, safUri value is

“content://com.android.externalstorage.documents/tree/primary%3ADocuments/document/primary%3ADocuments%2Fdoc.pdf”

The value of directoryUri and the safUri prefix are different. Is this behavior correct?

I would have expected the following value for safUri:

“content://com.android.externalstorage.documents/tree/primary%3ADocuments/doc.pdf”

Am I wrong ?

SDK Version (managed workflow only)
45.0.0

Environment
expo-env-info 1.0.5 environment info:
System:
OS: Windows 10 10.0.19043
Binaries:
Node: 14.15.1 - C:\Program Files\nodejs\node.EXE
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 27, 28, 29, 32, 33
Build Tools: 26.0.2, 27.0.3, 28.0.3, 29.0.0, 30.0.3, 33.0.0
System Images: android-27 | Intel x86 Atom_64, android-28 | Intel x86 Atom_64
npmPackages:
babel-preset-expo: ~9.1.0 => 9.1.0
expo: ^45.0.6 => 45.0.6
react: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
Expo Workflow: managed

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.