with-rn-firebase icon indicating copy to clipboard operation
with-rn-firebase copied to clipboard

Missing notification icon config in AndroidManifest.xml

Open jkk opened this issue 4 years ago • 2 comments

Thanks for creating this plugin! It works great for allowing our managed app to utilize Firebase Cloud Messaging on iOS and Android.

The only problem we ran into is that the notification icon on Android shows up as the dreaded white/gray square.

To fix it, we had to run expo prebuild then add the following line to AndroidManifest.xml manually:

<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />

(after the lines with expo.modules.notifications)

This is the only issue preventing us from creating a fully-functional build with EAS. Everything works perfectly on iOS.

While we could attempt to write our own plugin to fix this, it seems like it may be a worthwhile addition to with-rn-firebase?

jkk avatar Jul 01 '21 20:07 jkk

We just discovered that adding icon to the notification payload per the docs below also fixes this issue, without needing to modify AndroidManifest.xml:

https://firebase.google.com/docs/cloud-messaging/http-server-ref#notification-payload-support

We are now up and running with EAS build on both platforms! Thanks again for this plugin -- you released it at the perfect time.

I'll leave this issue open in case it's something worth adding as a default, but feel free to close.

jkk avatar Jul 01 '21 20:07 jkk

Hello, I'm glad that you managed to run a fully functional EAS build!

The notification icon seems to be such a complex subject, I'll look into that more deeply when I find some time. Meanwhile, if you ever had similar problems with notifications, you can take a look at the expo-notifications Android plugin source code. It uses FCM under the hood, and should be compatible. Also, feel free to fork/modify/PR/do whatever you wish with the plugin code :)

barthap avatar Jul 02 '21 05:07 barthap