Skip to main content

Collecting configuration information

Before getting your hands dirty with code, some configuration needs to be taken care of. Configuration information collected in this guide is used in later steps of the setup and in the configure() call: 1 or 2.

You do not need to use Firebase to configure Google Sign In.

Android

Follow the two steps below to set up Google Sign In for your Android app.

warning

In case you encounter any of the following issues, revisit this guide - it means the steps below weren't fully completed.

  • if you ever get the infamous DEVELOPER_ERROR error
  • if you can sign in with debug APK and not in release (or vice versa)

Step 1: Collect SHA-1 (not SHA-256) certificate fingerprints

Your Android app probably uses multiple signing configurations. For example, an app might be signed differently when building debug and release APKs locally or when building on Expo EAS. Then there's the Play App Signing for store deployments — Google Play Store may re-sign your app using one of its own signing configurations.

important

If your app is not yet in the Play Store, focus only on the development APK and its SHA-1 certificate fingerprint. You can come back to this guide later when you upload your app to the Play Store.

However, be advised that in the end, you need to get the SHA-1 certificate fingerprints for all signing configurations and then use all of those SHA-1 fingerprints in Step 2 below.

Collect SHA-1 certificate fingerprints from:

Use the Configuration Doctor. (Requires an Universal sign in license.)

  1. Get a device / emulator with the app installed, or get the APK (build it locally or in cloud, download from the Play Console / Play Store...)
  2. Run the tool and follow its instructions:
npx @react-native-google-signin/config-doctor


Step 2: Add SHA-1 fingerprints to Firebase or Google Cloud Console

Using all of the SHA-1 fingerprints obtained in the previous step, follow the instructions below.

  1. Sign in to Firebase Console and open your project.
  2. Ensure that in the "Authentication" menu, "Google" is enabled as "Sign-in method".
  3. Click the settings icon and go to "Project settings".
  4. Scroll down to "Your apps" section, and select the app.
  5. Click "Add fingerprint".
  6. Check that "Package name" is correct.
  7. Download the google-services.json file.

Firebase, add Android keystore's SHA-1 to your project


iOS

Read below on how to set up Google Sign In for your iOS app.

  1. Sign in to Firebase Console and open your project.
  2. Ensure that in the "Authentication" menu, "Google" is enabled as "Sign-in method".
  3. Click the settings icon and go to "Project settings".
  4. Scroll down to "Your apps" section, and select the app.
  5. Check that "Bundle ID" is correct.
  6. Download the GoogleService-Info.plist file.

Web Client ID

To get a Web Client ID (for the configure() call), go to Google Cloud Console and find an existing one (it may have been already created by Firebase) or create a new OAuth Client ID of type Web.


Summary

At the end of this guide, regardless of whether you use Firebase, when you visit Google Cloud Console, you should have in the "OAuth 2.0 Client IDs" section:

  • Android OAuth Client ID(s) with SHA-1 fingerprints
  • iOS OAuth Client ID(s) with iOS URL scheme
  • Web Client ID