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

Conversation

@dvdchr
Copy link
Contributor

@dvdchr dvdchr commented Aug 3, 2021

Closes #609

This updates GoogleSignIn to version 6.0.1, enabling support for M1. Some adjustments were required due to breaking changes introduced in version 6.0.0. Google has conveniently provided a migration checklist:

  • Update all [GIDSignIn sharedInstance] (or GIDSignIn.sharedInstance()) calls to GIDSignIn.sharedInstance property accesses.

  • Move all client configuration (client IDs, etc.) to a GIDConfiguration object.

  • Update calls to removed methods to their new equivalents:

    v5.x.x v6.0.0 Status
    signIn signInWithConfiguration:presentingViewController:callback: ✅ Done. Previous signIn method in GIDSignInDelegate extension is migrated.
    restorePreviousSignIn restorePreviousSignInWithCallback: ✅ Done. Method is not used.
    disconnect disconnectWithCallBack: ✅ Done. Previous disconnect method in GIDSignInDelegate is not implemented, so there's no need to define the callback.
    getTokensWithHandler: doWithFreshTokens: ✅ Done. Method is not used.
    refreshTokensWithHandler: doWithFreshTokens ✅ Done. Method is not used.
  • Remove all references to the GIDSignInDelegate protocol and its methods.

    • Move the logic from signIn:didSignInForUser:withError: to the callback block of signInWithConfiguration:presentingViewController:callback:.
    • Move the logic from signIn:didDisconnectWithUser:withError: to the callback block of disconnectWithCallback:.
  • Manually connect GIDSignInButton to a method that calls signInWithConfiguration:presentingViewController:callback: using an IBAction or similar.

Todos:

  • Ensure that this change does not affect the authentication flow in WordPress.
  • Ensure that this change does not affect the authentication flow in WooCommerce.
  • Bump podspec version to 1.41.0-beta.2

@dvdchr dvdchr added the enhancement New feature or request label Aug 3, 2021
@dvdchr dvdchr self-assigned this Aug 3, 2021
Copy link
Contributor

@ealeksandrov ealeksandrov left a comment

Choose a reason for hiding this comment

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

Thank you for this update!
Code changes: ✅
Nit: don't forget to add 1.41.0-beta.2 tag on latest commit here, so we won't need to specify branch name in client Podfiles (which also will break after a merge and branch deletion here).

I've tested it on:

  • WC-iOS (woocommerce/woocommerce-ios#4725)
    • with fresh Google email, linking it to WP account in process
    • logged out and back in with same email
  • WP-iOS (wordpress-mobile/WordPress-iOS#16974)
    • logged in with Google account linked above, logging out
    • disconnected Google on WP.com
    • connected Google account with same WP account back in WP-iOS login flow

All tested on M1, but with Xcode in Rosetta mode.

LGTM! :shipit:

@dvdchr dvdchr merged commit fab4ba2 into develop Aug 5, 2021
@dvdchr dvdchr deleted the issue/609-googlesignin-v6 branch August 5, 2021 07:33
@dvdchr
Copy link
Contributor Author

dvdchr commented Aug 5, 2021

Thanks @ealeksandrov! I've tagged the merge commit and published a pre-release for version 1.41.0-beta.2. 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update GoogleSignIn dependency to 6.0

3 participants