How to use react native firebase in Expo app

I have a React Native/Expo app where I am trying to use Firebase Cloud Messaging on an Android Device. I am stuck on implementing a successful Firebase Cloud Messaging initialization on Android.

I am completely stuck on this React Native Firebase error: you attempted to use a firebase module that's not installed on your Android project by calling "firebase.app()"

Hello,
To use React Native Firebase in an Expo app, you need to follow these steps:

Set up a Firebase project:

Go to the Firebase console (https://console.firebase.google.com/) and create a new project.
Configure your Android app within the Firebase project by providing the package name of your Expo app.
Download the google-services.json file and keep it handy.
Install the necessary packages:

Run the following command in your Expo project directory to install the required packages:
expo install react-native-firebase@v5
Configure the Firebase SDK:

Create a file named firebase.js (or any name you prefer) in your project’s root directory.

Inside the firebase.js file, add the following code:
import firebase from ‘react-native-firebase’;

const config = {
// Add your Firebase configuration here
// apiKey: ‘<YOUR_API_KEY>’,
// authDomain: ‘<YOUR_AUTH_DOMAIN>’,
// databaseURL: ‘<YOUR_DATABASE_URL>’,
// projectId: ‘<YOUR_PROJECT_ID>’,
// storageBucket: ‘<YOUR_STORAGE_BUCKET>’,
// messagingSenderId: ‘<YOUR_MESSAGING_SENDER_ID>’,
// appId: ‘<YOUR_APP_ID>’,
};

firebase.initializeApp(config);

export default firebase;
Uncomment and fill in the necessary Firebase configuration values (apiKey, authDomain, etc.) from your Firebase project.

Configure the Android project:

In your Expo project, navigate to android/app/build.gradle.

Add the following lines at the bottom of the file:
apply plugin: ‘com.google.gms.google-services’
In the same directory, open android/build.gradle.

Add the following classpath to the dependencies:
dependencies {
// other dependencies…

classpath ‘com.google.gms:google-services:4.3.10’
}
Add the google-services.json file:

Copy the google-services.json file you downloaded from the Firebase console to the android/app directory of your Expo project.
Test the Firebase setup:

In any component where you want to use Firebase, import the firebase module:
import firebase from ‘…/path/to/firebase.js’;
You can now use Firebase features like Firebase Cloud Messaging (FCM) in your Expo app using the firebase module. For example, to initialize FCM, you can use:
const messaging = firebase.messaging();
// Use messaging instance to subscribe, listen to events, etc.

Hi @keltouma

Have you been following these instructions?

Note that React Native Firebase will not work in the Expo Go app. But you can create a development build to use instead. A development build is basically like a custom version of Expo Go that has your dependencies built in, including native ones like React Native Firebase.