Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[image_picker] add requestFullMetadata for iOS (optional permissions) #5915

Merged
merged 63 commits into from
Oct 5, 2022

Conversation

PiotrMitkowski
Copy link
Contributor

@PiotrMitkowski PiotrMitkowski commented Jun 6, 2022

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • 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.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

Updated changelog with description of latest changes
…-permissions

� Conflicts:
�	packages/image_picker/image_picker_platform_interface/CHANGELOG.md
�	packages/image_picker/image_picker_platform_interface/pubspec.yaml
Added missing native implementation of the new flag
…ermissions

� Conflicts:
�	packages/image_picker/image_picker/CHANGELOG.md
�	packages/image_picker/image_picker/ios/Classes/FLTImagePickerPlugin.m
�	packages/image_picker/image_picker/pubspec.yaml
…ermissions

� Conflicts:
�	packages/image_picker/image_picker/CHANGELOG.md
�	packages/image_picker/image_picker_platform_interface/CHANGELOG.md
�	packages/image_picker/image_picker_platform_interface/pubspec.yaml
@idish
Copy link

idish commented Sep 14, 2022

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?

@PiotrMitkowski
Copy link
Contributor Author

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

@PiotrMitkowski
Copy link
Contributor Author

@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
Copy link

idish commented Sep 18, 2022

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

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! It just needs the final version update for your bugfix and it should be good to go! Thanks again for all the work on this.

@cyanglaz Can you do the secondary sign-off?

@@ -24,8 +24,8 @@ dependencies:
sdk: flutter
image_picker_android: ^0.8.4+11
image_picker_for_web: ^2.1.0
image_picker_ios: ^0.8.4+11
image_picker_platform_interface: ^2.3.0
image_picker_ios: ^0.8.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 0.8.6+1 now to pick up the last fix.

Copy link
Contributor Author

@PiotrMitkowski PiotrMitkowski Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still waiting for this version to be published on pub.dev. It seems that the release action failed. Could you take a look? https://github.com/flutter/plugins/actions/runs/3084943502

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry about that; I forgot to check that publishing had completed. It looks like there was a flake in the analysis run during post-submit tests, and it's already being re-run.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's live. Sorry for the delay!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good to go now, thanks!

@PiotrMitkowski PiotrMitkowski marked this pull request as ready for review September 21, 2022 07:09
@stuartmorgan
Copy link
Contributor

@cyanglaz Ping from triage on this review.

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@liumengchun
Copy link

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

@PiotrMitkowski PiotrMitkowski deleted the ios-optional-permissions branch October 21, 2022 08:45
@PiotrMitkowski
Copy link
Contributor Author

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

@furaiev
Copy link
Contributor

furaiev commented Oct 21, 2022

@PiotrMitkowski thank you, great work 👏

adam-harwood pushed a commit to adam-harwood/flutter_plugins that referenced this pull request Nov 3, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
… - platform interface changes for multi image picking (flutter#5914)

Platform interface changes for flutter#5915 - adding possibility to disable full metadata when picking multiple images
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: image_picker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[image_picker] choosing Select Photos permission shows all photos
7 participants