Google Sign-In quick migration guide

  • This page provides migration guides for updating your app to the latest Google Sign-In SDK versions (v7.0.0+ and v6.0.0).

  • For v7.0.0+, OAuth client configuration should be set in Info.plist, additional scopes are requested from GIDGoogleUser, and various properties and methods have been moved or updated.

  • Migrating to v6.0.0 involves using GIDConfiguration for client configuration, updating method calls, and replacing GIDSignInDelegate with callback blocks.

  • Detailed information and examples are available in linked resources like release notes, GitHub repository, and the "Get Started" guide.

This page details key changes for major versions of the Google Sign-In SDK.

Follow this guide to migrate your app to the latest version of the Google Sign-In SDK. Note that the documentation always refers to the most recent version.

Also refer to the release notes and the repository on GitHub for more information.

Google Sign-In SDK v7.0.0+

To migrate your app from a version of the Google Sign-In SDK prior to v7.0.0, make the following changes:

v6.2.x v7.0.0+
GIDSignIn
signInWithConfiguration:presentingViewController:callback:
GIDSignIn
signInWithPresentingViewController:completion:
GIDSignIn
restorePreviousSignInWithCallback:
GIDSignIn
restorePreviousSignInWithCompletion:
GIDSignIn
disconnectWithCallback:
GIDSignIn
disconnectWithCompletion:
GIDAuthentication
doWithFreshTokens:
GIDGoogleUser
refreshTokensIfNeededWithCompletion:
GIDSignIn
addScopes:presentingViewController:callback:
GIDGoogleUser
addScopes:presentingViewController:completion:

Google Sign-In SDK v6.0.0

To migrate your app from a version of the Google Sign-In SDK prior to v6.0.0, make the following changes:

  • Update all [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
    signIn signInWithConfiguration:presentingViewController:callback:
    restorePreviousSignIn restorePreviousSignInWithCallback:
    disconnect disconnectWithCallback:
    getTokensWithHandler: doWithFreshTokens:
    refreshTokensWithHandler: doWithFreshTokens:
  • 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.