Closed muhsin-k closed 6 years ago
Hi @muhzi4u, Are you referring to iOS or Android push notifications?
Both android and ios
FCM only lets you set the notification icon for Android notifications, using the icon
parameter, which must be the name of a @drawable/
resource included with the app:
// as object
message.addNotification({
title: 'Alert!!!',
body: 'Abnormal data access',
icon: 'ic_launcher'
});
https://github.com/ToothlessGear/node-gcm#notification-usage
Hi @eladnava , I have tried the above steps to add the icon to the android notification through node-gcm however the icon still does not appear. Is there a change or what can I be doing wrong?
Hi @Shivendra30,
Please make sure you placed your icon file in your drawables-*
folder in PNG format with the same name the icon
parameter passed to message.addNotification()
.
Hi @eladnava , I did that but it did not work Then I found out that For 5.0 Lollipop "Notification icons must be entirely white". This post helped me out - https://stackoverflow.com/questions/30795431/android-push-notifications-icon-not-displaying-in-notification-white-square-sh :)
Ah, nice catch 👍
this is working, but... sending the white (very small icon) as the image appear next to the title and message. the desirable end result is to have the small icon next to a main large avatar image, like on FB how can that be achieved?
the result im getting is the icon specified above as the large icon in the image and the small one and there is no small one..
if I don't send icon
value at all I get the app icon as the main and a small empty white square on the bottom right
Hi Guys. Thanks for your awesome work. Can we set an icon for a custom push notification icon, as an addition to the app's icon & splash screen from the server?