Firebase Push Notifications

  1. First, open firebase console and login
  2. Disable Google Analytics (optional, but recommended for simpler setup)
  3. Click "Create project" and wait for provisioning to complete
  4. Click "Continue" to access your project dashboard 

For Android

  1. Click the Android icon on the project overview page
  2. Enter your Android package name (e.g., com.example.myapp)
  3. Add an app nickname (optional)
  4. Click "Register app"
  5. Download the google-services.json file
  6. Place it in your Android app's app/ folder
  7. Install react native firebase packages (/app and /messaging) and also install @notifee package for android foreground push notification
  8. Setup the firebase in your App.tsx file main file.
  9. Go to "Messaging" in the left sidebar
  10. Click "Create your first campaign"  "Firebase Notification messages"
  11. Enter message title and text
  12. Click "Send test message"
  13. Enter your device's registration token
  14. Click "Test"

For Ios

  1. In Firebase Console, click "Add App" → Choose iOS 

  2. Enter your app's Bundle Identifier (this is case-sensitive and cannot be changed later) 

  3. (Optional) Add App nickname and App Store ID 

  4. Click "Register app"

  5. Download GoogleService-Info.plist and move it to your Xcode project root 

  6. Click "Next" and complete the setup 

  7. Open your project in Xcode and select the target 

  8. Go to Signing & Capabilities tab 

  9. Click "+ Capability" and add:

    •  Push Notifications 

    •  Background Modes → Enable Remote Notifications 

  10. Go to Apple Developer Member Center 

  11. Navigate to Certificates, Identifiers & Profiles  Keys 

  12. Click "+" to create a new key 

  13. Name your key and enable "Apple Push Notifications service (APNs)" 

  14. Click "Register" and download the .p8 file 

  15. In Firebase Console, go to Project Settings (gear icon) 

  16. Select the "Cloud Messaging" tab 

  17. Under "iOS app configuration", click "Upload" for APNs Authentication Key 

  18. Upload your .p8 file 

  19. Enter the Key ID (from Apple Developer Portal) and Team ID (from Membership Details) 

  20. Click "Upload" 

  21. Install react native firebase packages (/app and /messaging) and also install @notifee package for android foreground push notification
  22. Setup the firebase in your App.tsx file main file.
  23. In Firebase Console, go to "Messaging" 

  24. Click "Create your first campaign"  "Firebase Notification messages" 

  25. Enter message title and text 

  26. Click "Send test message" 

  27. Enter your device's FCM registration token 

  28. Click "Test" 

Did you find this article useful?