0

I am developing an Expo app and want to implement push notifications with images. Unfortunately, expo-notifications does not support images in push notifications, so I want to use @react-native-firebase/messaging instead to handle FCM directly.

My problem:

  • When I try to use @react-native-firebase/messaging in a managed Expo app, I get errors or it doesn’t work properly.

  • I understand Expo manages native dependencies differently and may require ejecting (bare workflow) to use react-native-firebase.

  • But I want to avoid ejecting if possible or at least want a step-by-step guide on how to set it up correctly.

Questions:

  1. Is it possible to use @react-native-firebase/messaging in an Expo managed workflow (without ejecting)?

  2. If yes, what is the correct setup procedure?

  3. If no, what is the recommended approach to send push notifications with images in an Expo app?

  4. Alternatively, what is the best practice to send push notifications with images using Expo or Firebase?

What I have tried:

  • Installed @react-native-firebase/messaging

  • Followed basic React Native Firebase docs

  • Got errors related to native modules not linked / unsupported in managed workflow

Environment:

  • Expo SDK version: 54.0.8

  • "@react-native-firebase/app": "^23.5.0",
    

    "@react-native-firebase/messaging": "^23.5.0",

  • React Native version: 0.81.4

error when i run eas build --profile development --platform android I get this error:

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : Attribute meta-data#com.google.firebase.messaging.default_notification_color@resource value=(@color/notification_icon_color) from AndroidManifest.xml:16:88-137
    is also present at [:react-native-firebase_messaging] AndroidManifest.xml:46:13-44 value=(@color/white).
    Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 2m 11s

When i run npx expo start there, I get this error and nothing works:

ERROR [Error: Native module RNFBAppModule not found. Re-check module install, linking, configuration, build and install steps.]

1
  • 1
    A question is meant to be a question, not a survey. Asking multiple questions makes your question post vague. Can you narrow it down to a single question? Commented Nov 19 at 9:21

2 Answers 2

0

Push notifications (remote notifications) functionality is unavailable in Expo Go on Android from SDK 53 per their documentation. This extends to both expo-notifications (as mentioned in the documentation), and @react-native-firebase/messaging as Expo Go no longer supports remote notifications.

You are getting this error:

ERROR [Error: Native module RNFBAppModule not found. Re-check module install, linking, configuration, build and install steps.]

because you are attempting to import @react-native-firebase/app or @react-native-firebase/messaging without using a development build as it's not supported in Expo Go.

If you are getting that error, or similar error, while on the development build try rebuilding with EAS. This can often happen if you use npm install @react-native-firebase/app and import without rebuilding.

Expo has great documentation their development builds about and learn how to create a development build.

For a step by step guide I recommend this youtube video. But as always documentation is going to be the best resource:

React Native Firebase

Expo

Sign up to request clarification or add additional context in comments.

Comments

0

Yes — you can use @react-native-firebase/messaging in Expo SDK 53+ using Development Builds (no full eject required).

Expo SDK 51+ added support for Config Plugins, which allow React Native Firebase to work without switching to a fully bare workflow. The setup requires a few extra steps to avoid Android manifest conflicts.

Solution Overview

  1. Use Expo Development Builds (not Expo Go)

  2. Add the Firebase Messaging config plugin

  3. Add a custom config plugin to fix Android manifest meta-data conflicts

  4. Add notification colors for Android

1. **Install Dependencies

npx expo install @react-native-firebase/app @react-native-firebase/messaging **

2. Add Firebase Config Files

  • Android: google-services.json → project root

  • iOS: GoogleService-Info.plist → project root

3. Create a Custom Config Plugin to Fix Manifest Conflicts

Create withFirebaseMessagingMeta.js in your project root:

const { withAndroidManifest } = require('@expo/config-plugins');

const withFirebaseMessagingMeta = (config) => {
  return withAndroidManifest(config, async (config) => {
    const androidManifest = config.modResults;
    const application = androidManifest.manifest.application[0];

    application['meta-data'] = application['meta-data'] || [];
    application['meta-data'].push({
      $: {
        'android:name': 'com.google.firebase.messaging.default_notification_color',
        'android:resource': '@color/notification_icon_color',
        'tools:replace': 'android:resource',
      },
    });

    return config;
  });
};

module.exports = withFirebaseMessagingMeta;

This resolves the conflict between expo-notifications and @react-native-firebase/messaging.

4. Update app.config.ts or app.json

Add Google services files and register the plugin:

export default {
  ios: {
    googleServicesFile: './GoogleService-Info.plist',
  },
  android: {
    googleServicesFile: './google-services.json',
  },
  plugins: [
    [
      'expo-notifications',
      {
        icon: './assets/icon.png',
        color: '#000000',
      },
    ],
    './withFirebaseMessagingMeta.js', // <--- Add this plugin
  ],
};

5. Initialize Firebase in Your App

(Standard Firebase initialization as usual.)

6. Build with Expo Development Client

# Generate native code

npx expo prebuild

# Build development client

eas build --profile development --platform android

# or

eas build --profile development --platform ios

✔ Summary

The critical fix is the custom config plugin (withFirebaseMessagingMeta.js).
It adds:

tools:replace="android:resource"

…which prevents the Android manifest conflict between Expo Notifications and Firebase Messaging over the default_notification_color meta-data entry.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.