my solution:
const permissions = await FileSystem.StorageAccessFramework.requestDirectoryPermissionsAsync()
if (permissions.granted) {
await FileSystem.StorageAccessFramework.createFileAsync(permissions.directoryUri, fileName, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
.then(async (uri) => {
await FileSystem.writeAsStringAsync(uri, fileData, { encoding: FileSystem.EncodingType.Base64 })
}
)
.catch(error => Alert.alert("error", "Sorry, we can't upload to this folder! Please choose another folder! "))
}
But I need to save the file without await FileSystem.StorageAccessFramework.requestDirectoryPermissionsAsync()
because it's not user friendly