React Native - Push Notification using Firebase (Android / IOS)

Notifications are an important tool used on most Android & iOS applications, used to improve user experience, used to engage users with your application, and much more.

 

Setting Up Push Notification in the React Native Application

               Installation:

1.      Create a New Firebase Project

2.      Install Firebase SDK into your app

3.      Push Notification Code Implementation

Create a New Firebase Project:

 

1.      Go to (https://console.firebase.google.com/?pli=1)



2.      Click on Create a Project



3.      Put your Project name and continue until you reached to the below



4.      Now click on Android symbol (IOS for IOS app)

5.      Now put your package name (FROM android manifest.xml) to below screen





6.      Click on Register app button

7.      Download the google-service.json file and Press Next and continue to console.


 

8.      Now place the downloaded google-service.json file into your app (Android/app) directory


9.      Now your firebase project setup is completed.

 

Install Firebase SDK into your app

              

# If Using npm

npm install --save @react-native-firebase/app

# If Using Yarn

yarn add @react-native-firebase/app


Now Lets setup android

            1. Goto /android/build.gradle file
            2. Add
                classpath 'com.google.gms:google-services:4.3.13'

            3. Now goto /android/app/build.gradle file
            4. Add plugin at the top and add
                apply plugin: 'com.google.gms.google-services'
                

            5. Android setup is completed

Post a Comment

Previous Post Next Post