1

I am trying to send notifications through firebase to Android. All is setup and working fine in terms of communication between the app and Firebase. Notifications are sending and receiving fine.

The issue I am having is the notification icon that is being shown is a white square. Now before you say this is duplicate, I have already read this answer and have tried it.

My Manifest file now has the

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

The notification icon is still a white square. Interestingly enough, the color does not seem to affect the notification properly (yes, the color is set up in values). It still displays as such: image

Edit: Is there a specific requirement for the image size? I have tried using my icon (png) 512x512, also 32x32 and neither have worked

UPDATE: I realized that the issue was that I am in the app when the notification arrives and so it doesn't show properly. When I exit the icon displays. Why does it not show the icon when in app?

1 Answers1

0

I managed to fix the issue. Apparently the notifications were showing in the background but not while the app is open.

To fix this, I had to add a .setSmallIcon(R.drawable.icon_test3) in the sendNotification method of the Service where it's building a notification. Make sure that the image is small, for me 32x32 worked.