You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app for Android and Desktop that follows the following basic flow:
User selects a folder from a FolderPicker and a bookmark for the folder is saved using SaveBookmarkAsync().
User selects a file from the contents of the folder in 1, and a bookmark is saved using SaveBookmarkAsync().
User edits file.
On restarting the app, I expect to be able to drill down through the saved Folder/File bookmarks to immediately begin editing the previously selected file. On Desktop this all works fine, because a bookmark is just a file path.
On Android however I'm having two issues:
Calling OpenFolderBookmarkAsyns() on the bookmark from 1 returns an IStorageFolder as expected, but then calling GetItemsAsync() results in a SecurityException claiming no permissions. Shouldn't SaveBookmarkAsync() have persisted the permissions?
Calling SaveBookmarkAsync() on an IStorageFile found via GetItemsAsync() immediately results in a SecurityException claiming no persistable permissions found. As far as I can tell having acquired the IStorageFolder from the folder picker should have given the app permission to access the files contained within, so I don't know why this would be failing but can sort of understand as the file itself wasn't found via file picker and thus wasn't explicitly given permission by the user to access.
Am I missing something here about using the Avalonia StorageProvider on Android to persist access to files? By experimenting in a fork of Avalonia I did find that changing SaveBookmarkAsync to include
before the call to TakePersistableUriPermission solved problem 2 above. It doesn't feel like the correct solution, but I haven't been able to figure out enough about how the Android storage framework actually works yet to know one way or another.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have an app for Android and Desktop that follows the following basic flow:
On restarting the app, I expect to be able to drill down through the saved Folder/File bookmarks to immediately begin editing the previously selected file. On Desktop this all works fine, because a bookmark is just a file path.
On Android however I'm having two issues:
Am I missing something here about using the Avalonia StorageProvider on Android to persist access to files? By experimenting in a fork of Avalonia I did find that changing SaveBookmarkAsync to include
before the call to TakePersistableUriPermission solved problem 2 above. It doesn't feel like the correct solution, but I haven't been able to figure out enough about how the Android storage framework actually works yet to know one way or another.
Beta Was this translation helpful? Give feedback.
All reactions