plugins
plugins copied to clipboard
[image_picker] add requestFullMetadata for iOS (optional permissions)
Description
Originally #3264 made by @cpboyd Creating a new PR as I've closed the previous one (#4638) by a mistake
Make iOS 11+ permissions requests optional per https://developer.apple.com/forums/thread/653414. PHAssets aren't actually required and there was already some fallback code in place.
Related issues
Fixes flutter/flutter#65995
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
- [x] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use
dart format
.) - [x] I signed the CLA.
- [x] The title of the PR starts with the name of the plugin surrounded by square brackets, e.g.
[shared_preferences]
- [x] I listed at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [x] I updated
CHANGELOG.md
to add a description of the change, following repository CHANGELOG style. - [x] I updated/added relevant documentation (doc comments with
///
). - [x] I added new tests to check the change I am making, or this PR is test-exempt.
- [x] All existing and new tests are passing.
@PiotrMitkowski Will you be able to continue working on this? It's totally fine if not; we can take it over (though it might take longer). I'm just asking because I'm trying to clean out our review queue.
@Hixie definitely yes, it's just blocked by another PR for iOS changes: https://github.com/flutter/plugins/pull/5713. I'll get back here as soon as those iOS changes are reviewed and merged.
Sorry about that review delay; the iOS changes have now been published!
Sorry about that review delay; the iOS changes have now been published!
No problem, thanks!
This looks great! Just one thing I overlooked in the original review: the README section about iOS permissions needs to be updated to discuss optionality of the library permission.
@stuartmorgan I've added a paragraph about new permissions handling. Let me know if that's what you had in mind.
Hey, I've just checked out this PR in my app (both on Simulator and real device).
Seems as _picker.pickMultiImage(requestFullMetadata: false);
is crashing after picking photos with the following error:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
This most probably an issue that resides within the new image_picker_ios (0.8.6) version, and not this PR directly, but still it worth mentioning it here before merging. Did anyone else have tested this code in a real environment?
@idish thanks for your feedback! I'll take an extra look to make sure, that it works correctly.
@idish I've found a bug and fixed it in #6429. You can take a look there, if you want. I'll put this PR in draft while waiting on the other one to be merged.
@idish I've found a bug and fixed it in #6429. You can take a look there, if you want. I'll put this PR in draft while waiting on the other one to be merged.
Thanks! I can confirm that your bugfix PR works.
@cyanglaz Ping from triage on this review.
Hello, have you fixed the problem of 'Select More Photos'? I have also reproduced the problem here
@liumengchun this is more like a workaround to not use the gallery permissions at all. They are needed only to access some specific image metadata, which isn't needed in most of the cases.
@PiotrMitkowski thank you, great work 👏