Installation
Install the react-native-firebase package in your project. Using NPM:Android Setup
To allow the Android app to securely connect to your Firebase project, a configuration file must be downloaded and added to your project. Download the google-services.json file and place it inside of your project at the following location: /android/app/google-services.json. Configure Firebase in Android: To allow Firebase on Android to use the credentials, the google-services plugin must be enabled on the project. This requires modification to two files in the Android directory. First, add the google-services plugin as a dependency inside of your /android/build.gradle file:iOS Setup
To allow the iOS app to securely connect to your Firebase project, a configuration file must be downloaded and added to your project. On the Firebase console, add a new iOS application and enter your project details. The “iOS bundle ID” must match your local project bundle ID. The bundle ID can be found within the “General” tab when opening the project with Xcode. Download the GoogleService-Info.plist file. Using Xcode, open the projects /ios/{projectName}.xcodeproj file (or /ios/{projectName}.xcworkspace if using Pods). Right-click on the project name and “Add files” to the project, as demonstrated below:


Handling Push Notification in React-Native
I am sharing the App.js file of my app, on clicking theSubscribe for push notification
button simply logs into CometChat with a demo user cometchat-uid-1
and calls the subscribe API. Please add your appId, apiKey, and region accordingly. Also, please make sure you have enabled Push Notification Extension from the Dashboard and added the FCM Server Key.