How to set notification icon in push notification

#1

Can you guide how can I set push notification icon. And where to put icon image and how to use icon with path in ionic code

#2

Which push notification service are you using?

#3

Using ionic native phone gap plugin for push notification

#4

I second this thread. Are we still in a situation that Ionic can’t automatically generate android push notification icon? Are we seriously supposed to first manually generate push notification icon and then copy them manually into android platform (every time we regenerate) or create a copy script to do this in build? I’m in disbelief since almost every App now days has push notifications of some sort.

And in case anyone was wondering, I’m using firebase to send notifications (general and end to end).

#5

I use Onesignal to handle my push notification and all i do is to open my config.xml file and add this code to it

<resource-file src="resources/android/icon/drawable-mdpi-icon.png" target="res/drawable-mdpi/ic_stat_onesignal_default.png" />
<resource-file src="resources/android/icon/drawable-hdpi-icon.png" target="res/drawable-hdpi/ic_stat_onesignal_default.png" />
<resource-file src="resources/android/icon/drawable-xhdpi-icon.png" target="res/drawable-xhdpi/ic_stat_onesignal_default.png" />
<resource-file src="resources/android/icon/drawable-xxhdpi-icon.png" target="res/drawable-xxhdpi/ic_stat_onesignal_default.png" />
<resource-file src="resources/android/icon/drawable-xxxhdpi-icon.png" target="res/drawable-xxxhdpi/ic_stat_onesignal_default.png" />

Then run the build process

1 Like
#6

Thank you! I have read dozens threads from google and none of them had this simple of an answer. I will give this a try.

#7

Noup :frowning: I give up. Can’t be done. Still a *sensored* grey circle on android.

#8

Test with another device and check

#9

I use Onesignal and it works perfectly