Step 1: First run this command for initialize a bare React Native project
npx @react-native-community/cli init myapp 👉 Replace 'myapp' with your desired app
name.
Step 2: Than navigate to your app directory and run those command:
cd myapp npx react-native start 👉 This command launches the Metro Bundler, which is a
JavaScript bundler specifically built for React Native. It compiles and serves your JavaScript
code to the mobile app, ensuring live reloading and fast refresh during development.
**npx react-native run-android** **👉** Run on Android emulator/device
Step 3: Install Required Packages
**npm install @react-native-firebase/app @react-native-firebase/messaging**
a) npm i @react-native-firebase/app **👉** This is the **base package** for using any Firebase services
in a React Native app.It initializes Firebase in your project and connects your app to your
Firebase project (via the `google-services.json` file).
b) npm i @react-native-firebase/messaging **👉** This is the specific package for Firebase Cloud ****
**** Messaging (FCM). It allows your app to receive push notifications in both foreground and cc
background. Without this, your app can't receive or manage push notifications from Firebase.
Step 4: Setup Firebase Project
a) Go to Firebase Console **👉** Get Started with a Firebase Project / create a Firebase Project
b) Create a new project.
****c) Add Firebase to your Android app (Register App)
d) Download the **google-services.json** (for Android).