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/messagingin 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:
Is it possible to use
@react-native-firebase/messagingin an Expo managed workflow (without ejecting)?If yes, what is the correct setup procedure?
If no, what is the recommended approach to send push notifications with images in an Expo app?
Alternatively, what is the best practice to send push notifications with images using Expo or Firebase?
What I have tried:
Installed
@react-native-firebase/messagingFollowed 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.]