-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[iOS] Implement Save File Picker Support #19364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -16,7 +16,6 @@ | |||
<array> | |||
<integer>1</integer> | |||
<integer>2</integer> | |||
<integer>3</integer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this since DeviceType 3 is used for tvOS, which breaks deployment for iOS.
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
* [iOS] Implement Save File Picker Support * Delete folder instead * Use StorageProviderHelpers * Use FromBytes to create blank file
files.mp4
What does the pull request do?
Implements SaveFilePickerAsync for Avalonia.iOS
What is the current behavior?
Throws an exception saying that Saving Files is unsupported.
What is the updated/expected behavior with this PR?
Allows for saving files on iOS and Mac Catalyst.
How was the solution implemented (if it's not obvious)?
UIDocumentPickerViewController can "export" and "copy" files to a user's device. For it to work, you need to create a temp file that is passed into the picker, set as a copy. The user picks the file name and location to save to. If they follow through, you get an IStorageFile with a URI that can be written to.
It's similar in approach to the MAUI CommunityToolkit implementation, except the file is written to after the fact.
Note that for Read/Write access from outside the App Sandbox, you need to enable
in the info.plist.