DEV Community

Md Nadeem Anwar
Md Nadeem Anwar

Posted on

How to Integrate Firebase in Our React Native Application🧨

In this article we will see how can we integrate firebase in our React Native Application.
To do this we will follow these step

Image description

Setp 1
We have to create React Native Application
command to create react native application
npx react-native@latest init Awesomeapp
Step 2
After creating React Native Application we have to create/login firebase account.
Go to Console

Image description

Firebase Home Screen

  1. Click on Create Project

Image description

firebase create project screen

  1. Go to Android icon

Image description

Main project setting screen
4.Give your Android package name and SH1 key

Image description

Register App screen

  1. Path to get package name android/app/scr/main/java/MainActivity.kt package name

android/app/scr/main/java/MainActivity.kt

Image description

Android package name
If you want to generate SH1 key then follow this article
Article Link:-

How to Generate SH1 Key in React Native App 🚀
Hello Everyone in this article we will know how to generate SH1 in React native Application.
medium.com
fastest way to generate SH1 key
Go to android directory and run this command

./gradlew signingReport

You will see your sh1 key is generated successfully
After Generating SH1 next step is click continue

Image description

Download this file

  1. Download google-service.json

Image description

Add this file to given path

  1. After Downloading file put google-service.json file to android/app folder Go to rnfirebase page Link: — https://rnfirebase.io/ React Native Firebase | React Native Firebase Welcome to React Native Firebase! To get started, you must first setup a Firebase project and install the “app” module. rnfirebase.io Install this library npm install --save @react-native-firebase/app We need to do 2 more thing Add this line of code into 2 file Add this line into android/build.gradle Add below in android/build.gradle classpath 'com.google.gms:google-services:4.4.1'

Image description

  1. Add below code into android/app/build.gradle apply plugin: 'com.google.gms.google-services'

Image description

implementation(platform("com.google.firebase:firebase-bom:32.7.3"))

Image description

Image description

Now firebase setup has been successfully done
For checking this .
Just go to android studio and sync your project if you don’t get error means you have successfully integrate firebase into your project.
Thank you for reading until the end. Before you go:
Please consider clapping and following the writer!
Follow us | LinkedIn
More content at Medium.com

Top comments (0)