Google Login in React Native with Firebase

Google Login reduces onboarding friction because many users already have a Google account on their phone. In React Native, the reliable pattern is to let a native Google Sign-In library collect the Google identity token, then pass that token to Firebase Authentication.
Quick Answerโ
For React Native apps that use Firebase:
- Configure Firebase for iOS and Android.
- Enable Google as a Firebase Auth provider.
- Add Android SHA fingerprints to Firebase.
- Install
@react-native-firebase/auth. - Install
@react-native-google-signin/google-signin. - Request a Google ID token.
- Create a Firebase Google credential.
- Sign in with
auth().signInWithCredential.
For the shared Firebase setup, start here:
Install Dependenciesโ
yarn add @react-native-firebase/app @react-native-firebase/auth
yarn add @react-native-google-signin/google-signin
cd ios && pod install
The Google Sign-In package has two tracks: Universal Sign In and Original Google Sign In. Universal Sign In is the forward-looking API, while many existing apps still use Original Google Sign In. Pick the path that matches your app and read the package documentation before shipping.
Mega Bundle Sale is ON! Get ALL of our React Native codebases at 90% OFF discount ๐ฅ
Get the Mega BundleFirebase Setupโ
In Firebase Console:
- Open Authentication.
- Go to Sign-in method.
- Enable Google.
- Confirm your app has the correct iOS bundle ID and Android package name.
- Add Android SHA-1 and SHA-256 fingerprints for every signing key you use.
- Download updated
GoogleService-Info.plistandgoogle-services.jsonfiles.
Most Android DEVELOPER_ERROR or code 10 issues come from a mismatch between
the installed app, the signing key, and the OAuth client configured in Firebase
or Google Cloud.
Sign in with Google and Firebaseโ
This example uses the Original Google Sign-In API because it is still common in existing React Native codebases:
import auth from '@react-native-firebase/auth';
import {
GoogleSignin,
isSuccessResponse,
} from '@react-native-google-signin/google-signin';
GoogleSignin.configure({
webClientId: 'YOUR_FIREBASE_WEB_CLIENT_ID',
});
export async function signInWithGoogle() {
await GoogleSignin.hasPlayServices({
showPlayServicesUpdateDialog: true,
});
const response = await GoogleSignin.signIn();
if (!isSuccessResponse(response)) {
return null;
}
const { idToken } = response.data;
if (!idToken) {
throw new Error('Google Sign-In failed: missing idToken');
}
const googleCredential = auth.GoogleAuthProvider.credential(idToken);
return auth().signInWithCredential(googleCredential);
}
Use the Web client ID from Firebase, not the Android client ID. On iOS, confirm
that GoogleService-Info.plist is included in the target and that the reversed
client ID URL scheme is configured.
Sign Out Correctlyโ
Firebase sign-out and Google sign-out are different operations. Clear both if you want the next login to show the account picker again.
export async function signOutGoogleUser() {
await auth().signOut();
await GoogleSignin.signOut();
}
If your product needs account deletion, revoke access and clean up backend data according to your privacy policy.
Production Checklistโ
- Enable Google in Firebase Auth.
- Use the correct web client ID.
- Add debug, release, CI, and Play App Signing fingerprints.
- Test iOS and Android release builds, not only debug builds.
- Link credentials when users can sign in with email, Apple, phone, or Facebook.
- Store the app user profile in Firestore after Firebase Auth succeeds.
- Keep social login buttons hidden until their provider setup is complete.
Useful Referencesโ
- React Native Google Sign-In documentation
- React Native Google Sign-In troubleshooting
- Firebase Google Sign-In on Android
- Firebase Google Sign-In on Apple platforms
- React Native Firebase Auth reference
- Instamobile Firebase setup docs
Looking for a custom mobile application?
Our team of expert mobile developers can help you build a custom mobile app that meets your specific needs.
Get in TouchConclusionโ
Google Login is straightforward when Firebase, Google Cloud, and the installed native app all point to the same project and signing keys. Most production bugs come from configuration drift, so keep your Firebase files, OAuth client IDs, and SHA fingerprints versioned in your release checklist.