Android Notification Icon not working [Android Studio + Capacitor]

I’m following the Android Studio guidelines for changing my app assets (icon, splash & notification). Icon and splashscreen are working but I can’t get the Notification icon to change from anything other than a white circle…

I’ve tried using my own custom icon (exported as just a white icon with no background color) and using one of Android Studio’s built in “Clip Art”. Neither work (which helps me rule out that my custom icon has some alpha/transparency layer issue)

I’ve checked stackoverflow but all solutions have to do with various Android API levels and configuring icon colors and background settings in Java (which I don’t want to do and I’m assuming most ionic dev don’t mess with)

Any suggestions would be greatly appreciated. I’ve spent hours testing and searching for hours. Hoping an Ionic Dev has encountered this and there’s a solution. :pray:t3:



Solved.

The capacitor docs mention it here and the firebase android messaging docs show that the following is needed in AndroidManifest.xml:

<!-- Set custom default icon. This is used when no icon is set for incoming notification messages.
     See README(https://goo.gl/l4GJaQ) for more. -->
<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/ic_stat_ic_notification" />
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
     notification message. See README(https://goo.gl/6BKBk7) for more. -->
<meta-data
    android:name="com.google.firebase.messaging.default_notification_color"
    android:resource="@color/colorAccent" />

Bonus: that @color/colorAccent is pulled from the variables.scss --ion-color-primary so the notification is colored when you pull the notification tray down. (its white while the top notification bar which follows the android design spec)

1 Like

I’m also doing same but i didn’t got icon, can any one tell me what is the issue

Thanks so much! this help me! i’m using Quasar v1