VOOZH about

URL: https://www.geeksforgeeks.org/react-native/how-to-authenticate-with-google-using-firebase-in-react-native-application/

⇱ How to Authenticate with Google using Firebase in React Native Application ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Authenticate with Google using Firebase in React Native Application ?

Last Updated : 4 Jul, 2025

In this article, we will discuss how can we authenticate with Google using Firebase in React Native.

Creating React Application And Installing Module

Create a React app using the following command:

npx react-native@latest init AwesomeProject

Project Structure👁 Screenshot-2023-09-12-130246

Now install required npm packages:

npm i @react-native-google-signin/google-signin
npm install --save @react-native-firebase/app
npm install --save @react-native-firebase/auth

Setup Your Project on Firebase

  • Enter the required detail for setup project you can find package name in your project Android folder to generate
  • SHA key run the following command from your project android folder ./gradlew signingReport
  • download the google.config.file and follow the instructions mention on firebase to add firebase SDK

👁 Screenshot-2023-09-06-152335

👁 Screenshot-2023-09-06-152450
👁 Screenshot-2023-09-06-152601

  • Go to authentication section on your firebase console and enable google sign in

👁 Screenshot-2023-09-07-085633

  • Adding google auth code to your project:

Example:

  • Replace your web client id with id given on your firebase project you can get web client id by
  • Go to ->Firebase console-> Authentecation-> google ->web client id:
 GoogleSignin.configure({
webClientId: 'Your client id', // Paste that web client id here
});
  • Run your react native app by command:
npm start  

Output:

Comment

Explore