Skip to main content

Obtaining configuration information

Before getting your hands dirty with code, some configuration needs to be taken care of. Be patient, this is the most complex part of the setup.

Configuration information obtained in this guide is used in later steps of the setup and in the configure() call: 1 or 2.

You do not need Firebase to configure Google Sign In. However, if you use it, it's a little easier to set up the sign in experience because Firebase gives you one file to download and put into your project.

Android

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

danger

Completing this guide is crucial for Google Sign-In to work on Android. If not done correctly, you will get the infamous DEVELOPER_ERROR error (how to troubleshoot it).

Step 1: Obtain SHA-1 certificate fingerprints

You probably use multiple signing configurations for your Android app - for example for building debug and release APKs locally or building on Expo EAS. Then there's the Play App Signing for store deployments - while the Google Play Store does not rebuild your app, it may re-sign it using one of its own signing configurations.

First, you need to obtain the SHA-1 certificate fingerprints for all of these signing configurations using the instructions below. Then, use all of those SHA-1 hashes in Step 2 below.

If you use Expo EAS, run eas credentials to obtain the Keystore information, which includes the SHA-1 fingerprint. See EAS credentials docs to learn more.

Step 2: Add SHA-1 hashes 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 and open your project.
  2. Ensure that in the "Authentication" menu, "Google" is enabled as "Sign-in method".
  3. Click the Settings icon and select Project settings.
  4. In the "Your apps" card, select the app you need to add SHA-1 to.
  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. Click the settings icon and go to "Project settings".
  3. Scroll down to "Your apps" section, and select the app.
  4. Check that "Bundle ID" is correct.
  5. Download the GoogleService-Info.plist file.

Web Client ID (optional)

For some use cases (offline support, web support), a Web Client ID is needed (provided to the configure() call). To obtain a Web Client ID, go to Google Cloud Console and find an existing one (it may be already created by Firebase) or create a new OAuth Client ID of type Web.