A guide on using @react-native-google-signin/google-signin library to integrate Google authentication in your Expo project.
@react-native-google-signin/google-signin library provides different ways, such as Firebase and Google API, to integrate Google authentication in your Expo app. It also provides native sign-in buttons and supports various authentication methods (standard, server-side validation, and offline access). You can use the library in your project by adding the config plugin in the app config.
This guide provides additional information on how to configure the library for your project, and different steps might be required depending on the authentication method you choose.
@react-native-google-signin/google-signin library can't be used in the Expo Go app because it requires custom native code. Learn more about adding custom native code to your app.
@react-native-google-signin/google-signin documentation for instructions on how to install and configure the library:
Below are instructions on how to configure your Google project for Android and iOS.
We recommend uploading the app to the Google Play Store if your app still needs to be in production. It is not necessary to upload the complete app if your project is still in the development process. Upload a single instance of your app. This will allow you to sign your app with the required certificates, such as the SHA-1 certificate fingerprint, which is required to provide when configuring the Google project for Android. To learn more about the app submission process, see the guides below in the order they are specified:
Once you have uploaded your app, you can provide an SHA-1 certificate fingerprint value when asked while configuring the Google project. There are two values that you can provide from:
For more instructions on how to configure your Google project for Android and iOS with Firebase:
If you use the Firebase method for Android and iOS (as shared in sections above), you'll need to upload google-services.json and GoogleService-Info.plist to EAS and add them to .gitignore to avoid checking them in the repository.
This is an alternate method to configure a Google project when you are not using Firebase.
For more instructions on how to configure your Google project for Android with Google API:
For iOS, if you use Google API instead of Firebase, you'll need to generate an OAuth client id. Follow the instructions below to generate the client id:
After you have created the iOS client id, you'll also need to provide the iOS URL scheme value in the app config. You can find the value in the Google API console under API and Services > Credentials > OAuth 2.0 Client IDs > name of your iOS client id > Additional information > iOS URL scheme.
Then, add the iOS URL scheme value in the app config under
ios.infoPlist as shown below: