tree: f34394c38bdda15cc9993f3990810a51c5cd977b [path history] [tgz]
  1. darwin/
  2. example/
  3. lib/
  4. pigeons/
  5. test/
  9. pubspec.yaml


The iOS and macOS implementation of google_sign_in.


This package is endorsed, which means you can simply use google_sign_in normally. This package will be automatically included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

macOS setup

The GoogleSignIn SDK requires keychain sharing to be enabled, by adding the following entitlements:


Without this step, the plugin will throw a keychain error PlatformException when trying to sign in.

iOS integration

  1. Create a Firebase project and register your application.
  2. Enable Google Sign-In for your Firebase project.
  3. Make sure to download a new copy of your project's GoogleService-Info.plist from step 2. Do not put this file in your project.
  4. Add the client ID from the GoogleService-Info.plist into your app's [my_project]/ios/Runner/Info.plist file.
    <!-- TODO Replace this value: -->
    <!-- Copied from GoogleService-Info.plist key CLIENT_ID -->
    <string>[YOUR IOS CLIENT ID]</string>
  5. If you need to authenticate to a backend server you can add a GIDServerClientID key value pair in your [my_project]/ios/Runner/Info.plist file.
    <string>[YOUR SERVER CLIENT ID]</string>
  6. Then add the CFBundleURLTypes attributes below into the [my_project]/ios/Runner/Info.plist file.
<!-- Put me in the [my_project]/ios/Runner/Info.plist file -->
<!-- Google Sign-in Section -->
			<!-- TODO Replace this value: -->
			<!-- Copied from GoogleService-Info.plist key REVERSED_CLIENT_ID -->
<!-- End of the Google Sign-in Section -->

As an alternative to editing the Info.plist in your Xcode project, you can instead configure your app in Dart code. In this case, skip steps 4 to 5 and pass clientId and serverClientId to the GoogleSignIn constructor:

final GoogleSignIn googleSignIn = GoogleSignIn(
  // The OAuth client id of your app. This is required.
  clientId: 'Your Client ID',
  // If you need to authenticate to a backend server, specify its OAuth client. This is optional.
  serverClientId: 'Your Server ID',

Note that step 6 is still required.