In this article we will see how can we integrate firebase in our React Native Application.
To do this we will follow these step
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
Firebase Home Screen
- Click on Create Project
firebase create project screen
- Go to Android icon
Main project setting screen
4.Give your Android package name and SH1 key
Register App screen
- Path to get package name android/app/scr/main/java/MainActivity.kt package name
android/app/scr/main/java/MainActivity.kt
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
Download this file
- Download google-service.json
Add this file to given path
- 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.gradleclasspath 'com.google.gms:google-services:4.4.1'
- Add below code into android/app/build.gradle
apply plugin: 'com.google.gms.google-services'
implementation(platform("com.google.firebase:firebase-bom:32.7.3"))
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)