plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[image_picker] add requestFullMetadata for iOS (optional permissions)

Open PiotrMitkowski opened this issue 2 years ago • 9 comments

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 avatar Jun 06 '22 10:06 PiotrMitkowski

@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 avatar Aug 30 '22 23:08 Hixie

@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.

PiotrMitkowski avatar Aug 31 '22 05:08 PiotrMitkowski

Sorry about that review delay; the iOS changes have now been published!

stuartmorgan avatar Aug 31 '22 15:08 stuartmorgan

Sorry about that review delay; the iOS changes have now been published!

No problem, thanks!

PiotrMitkowski avatar Sep 01 '22 06:09 PiotrMitkowski

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.

PiotrMitkowski avatar Sep 05 '22 15:09 PiotrMitkowski

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 avatar Sep 14 '22 08:09 idish

@idish thanks for your feedback! I'll take an extra look to make sure, that it works correctly.

PiotrMitkowski avatar Sep 14 '22 12:09 PiotrMitkowski

@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.

PiotrMitkowski avatar Sep 15 '22 06:09 PiotrMitkowski

@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.

idish avatar Sep 18 '22 10:09 idish

@cyanglaz Ping from triage on this review.

stuartmorgan avatar Sep 29 '22 20:09 stuartmorgan

Hello, have you fixed the problem of 'Select More Photos'? I have also reproduced the problem here

liumengchun avatar Oct 21 '22 07:10 liumengchun

@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 avatar Oct 21 '22 08:10 PiotrMitkowski

@PiotrMitkowski thank you, great work 👏

furaiev avatar Oct 21 '22 15:10 furaiev