-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[google_sign_in] Add macOS support #4962
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
test-exempt: Existing tests are being enabled for macOS in this PR (the bot just doesn't recognize the path). |
This isn't landable yet since it won't compile for macOS on the current stable, but I wanted to post it to ensure CI doesn't find any other issues. It can be reviewed now though, since the only change to actually land it (modulo fixing anything else CI turns up) will be bumping the min SDK version again after the next stable release. |
} | ||
completion(error == nil ? @(granted) : nil, error); | ||
}]; | ||
[self addScopes:requestedScopes.allObjects |
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 reason it looks like there are a lot of changes here (and in the previous block) is that switching to the new helper function without presentingViewController
changed the indentation of the whole block. The code in the block doesn't have any non-whitespace changes.
code:kGIDSignInErrorCodeHasNoAuthInKeychain | ||
userInfo:nil]; | ||
[[self.mockSignIn stub] disconnectWithCallback:[OCMArg invokeBlockWithArgs:error, nil]]; | ||
NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain |
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.
All the error renaming is because the macOS build settings catch variable shadowing, which apparently our iOS build doesn't have enabled, and the blocks in all of these methods have an error
parameter.
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.
Is there an issue filed to get the iOS lints consistent with the macOS lints? (also raises the question of whether macOS is missing any iOS lints)
hint:nil | ||
additionalScopes:OCMOCK_ANY | ||
callback:OCMOCK_ANY]); | ||
OCMVerify([self configureMock:self.mockSignIn |
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.
As with the changes in the implementation file, all of these changes are whitespace changes from the switch to the new configureMock
helper.
And I'll have to publish a new Flutter Pod so that the pod linter passes. |
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 iOS side LGTM, but looks like the macOS side is failing to build with
no visible @interface for 'NSObject<FlutterPluginRegistrar>'
That's:
The PR uses API that I added to the macOS engine recently, so doesn't exist on stable yet. |
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.
LGTM
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.
lgtm!
How would I test this on my flutter project for building a macos app that uses google_sing_io with your changes? |
|
Thank you for the PR! After completing the authentication in the Google Popup, the Future and the I can tell that the authentication never completes, as I am missing the email notification from Google. The only error/warning I get is this: |
Hi, when will this PR be merged? 😆 |
After I have time to manually publish a new FlutterMacOS pod so that CI analysis can pass. |
flutter/packages@ca16173...15584a3 2023-12-07 ditman@gmail.com [gis_web] Migrate to package:web. (flutter/packages#5581) 2023-12-07 kevmoo@users.noreply.github.com Drop quiver usage in several packages (flutter/packages#5595) 2023-12-07 stuartmorgan@google.com [video_player] Unfork publish: for macOS (flutter/packages#5578) 2023-12-07 kevmoo@users.noreply.github.com [web_benchmarks] migrate to pkg:web (flutter/packages#5592) 2023-12-07 43054281+camsim99@users.noreply.github.com [animations] Bump minimum supported Dart version to 3.2 (flutter/packages#5598) 2023-12-06 43054281+camsim99@users.noreply.github.com [animations] Bump minimum Flutter version (flutter/packages#5596) 2023-12-06 6655696+guidezpl@users.noreply.github.com Migrate Material curves to new names (flutter/packages#4898) 2023-12-06 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[pointer_interceptor] Add ios implementation and move web implementation to federated structure" (flutter/packages#5591) 2023-12-06 louisehsu@google.com [pointer_interceptor] Add ios implementation and move web implementation to federated structure (flutter/packages#5500) 2023-12-06 stuartmorgan@google.com [pigeon] Use dart:io output inheritance for tooling (flutter/packages#5536) 2023-12-06 43759233+kenzieschmoll@users.noreply.github.com Fix benchmark reload bug and migrate away from deprecated `js_util` APIs (flutter/packages#5577) 2023-12-06 stuartmorgan@google.com [google_sign_in] Add macOS support (flutter/packages#4962) 2023-12-06 ian@hixie.ch [rfw,flutter_markdown] Apparently you need a comma to end an //ignore (flutter/packages#5582) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Adds macOS support to `google_sign_in_ios` by moving the existing source to `darwin/`, adjusting it somewhat to be macOS-compatible, and enabling `sharedDarwinSource` in the podspec. Unlike previous cases of code sharing, this doesn't rename the package to be something more generic, since when we do that the name is based on the underlying SDK, and the SDK is still mostly called "Google Sign-In for iOS", so I don't think there's a better name to give it at the moment. Most of flutter/flutter#46157 (Once this lands, there will be a follow-up PR to update the app-facing package to endorse it and list it in the README.)
Adds macOS support to `google_sign_in_ios` by moving the existing source to `darwin/`, adjusting it somewhat to be macOS-compatible, and enabling `sharedDarwinSource` in the podspec. Unlike previous cases of code sharing, this doesn't rename the package to be something more generic, since when we do that the name is based on the underlying SDK, and the SDK is still mostly called "Google Sign-In for iOS", so I don't think there's a better name to give it at the moment. Most of flutter/flutter#46157 (Once this lands, there will be a follow-up PR to update the app-facing package to endorse it and list it in the README.)
Adds macOS support to
google_sign_in_ios
by moving the existing source todarwin/
, adjusting it somewhat to be macOS-compatible, and enablingsharedDarwinSource
in the podspec.Unlike previous cases of code sharing, this doesn't rename the package to be something more generic, since when we do that the name is based on the underlying SDK, and the SDK is still mostly called "Google Sign-In for iOS", so I don't think there's a better name to give it at the moment.
Most of flutter/flutter#46157
(Once this lands, there will be a follow-up PR to update the app-facing package to endorse it and list it in the README.)
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).