-
Notifications
You must be signed in to change notification settings - Fork 693
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
fix #1412: Picking a folder in iOS causes the original folder to be deleted. #1457
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
61dc2af
[ios] fixed bug where the plugin would move the selected directory to…
twinstar6980 dff1dde
Merge branch 'miguelpruivo:master' into master
twinstar6980 dda1d96
Merge branch 'master' into master
twinstar6980 0c245b0
update version and changelog
twinstar6980 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The
documentPickerMode
is deprecated. Could you rewrite this to only use the deprecated API up to iOS 14 ?See https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller#1658475
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.
Sorry, I don't have a mac device now, so I can't rewrite and test it.
In addition, I noticed that the deprecated API was also used in the previous code. Maybe this also needs to be migrated to the new API, but I am not familiar with objc.
BTW, on my own ios device, when using the
init(forOpeningContentTypes:)
swift api, I can directly get the absolute path of file/directory. Why doesn't file_picker use this api, but makes a cache file?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 do not now why file_picker uses a cache for that, maybe @miguelpruivo knows?
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.
There are 2 approaches when opening descriptors for files within app's container
2 is typically the preferred option since most of the apps use the files for either manipulating (editing) or, even if it's just for sending somewhere, it doesn't have any consequence. If I recall, this was the original approach from the Flutter's image_picker so I followed the same path.
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.
@navaronbracke @miguelpruivo
Please pay attention to #1412 . This bug is very serious on iOS and will endanger user data security.
It has been half a year since I raised the issue, but this dangerous bug still exists and has not been fixed.
This PR is made based on the current implementation, I know that
UIDocumentPickerMode
is a deprecated api, but the code in this library always uses this deprecated api when creatingUIDocumentPickerViewController
.In this case, why is this PR banned because I use the same deprecated API? (In fact, another PR #1452 that was approved also used the deprecated
UIDocumentPickerMode
api).I think a more reasonable solution is to first pass this PR to solve the BUG instead of banning this PR because of an deprecated api that already exists in the library.
Please allow me to repeat it again: this bug is very serious, it will delete files without the user knowing! Please don't keep this bug alive for longer.