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

[image_picker] optionally disable PHAsset & iOS permission request #3090

Closed
wants to merge 2 commits into from
Closed

[image_picker] optionally disable PHAsset & iOS permission request #3090

wants to merge 2 commits into from

Conversation

cpboyd
Copy link
Contributor

@cpboyd cpboyd commented Sep 29, 2020

Description

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.

To keep this as a non-breaking change, I added an optional parameter of iosPhaAsset with a default of true.
Setting this to false will disable any permissions checking on iOS and simply display the image picker.

I still need to update the tests.

Related Issues

Fixes flutter/flutter#65995

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

[self checkPhotoAuthorization];
break;
}
[self showPhotoLibrary];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may actually need a check for iOS 11 or higher

[self checkPhotoAuthorization];
break;
}
[self showPhotoLibrary];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As above, this may need a check for iOS 11 or higher

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Oct 5, 2020
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Oct 5, 2020
@cpboyd cpboyd changed the title [image_picker] optionally disable PHAsset [image_picker] optionally disable PHAsset & iOS permission request Oct 6, 2020
@cpboyd
Copy link
Contributor Author

cpboyd commented Nov 6, 2020

@cyanglaz Per flutter/flutter#65995 (comment), should I change iosPhaAsset to forceFullMetaData or are you working on your own PR?

@cyanglaz
Copy link
Contributor

cyanglaz commented Nov 6, 2020

Thanks for sending out this PR! I had a comment about this new flag here flutter/flutter#65995 (comment)
Could you rename the parameter as I commented?

The other changes would be pretty similar.

Integration testing this might be a little tricky. I will work on a PR to add some tests for you. Meanwhile, could you add some unit tests for this change?

@cyanglaz
Copy link
Contributor

@cpboyd I haven't started working on this yet, I'd like to help you land this PR :)
I have landed a PR to set up some XCUITests for the plugin, it will help you add integration tests in your PR. #3254

Please feel free to ping me if you have any questions, I'd be happy to review once the tests are added.

@cyanglaz
Copy link
Contributor

@cyanglaz Per flutter/flutter#65995 (comment), should I change iosPhaAsset to forceFullMetaData or are you working on your own PR?

Oh, I didn't see this :) yes, please rename it to forceFullMetaData, and add dart doc on the methods with the same message I added in my comment.

@cpboyd
Copy link
Contributor Author

cpboyd commented Nov 11, 2020

@cyanglaz It seems that since I modified my fork to be based off of the main repo (rather than another fork), it messed with GitHub's PR system.

I'll close this and re-open with the new changes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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