I am using ionic3 to build a hybrid app and use this fcm push notification cordova plugin for receiving notification
I have been able to achieve the notifications landing on the device and app being triggered (with data like title, body, custom, etc.)
But whenever the notification is delivered the notification icon is displayed as android bot. like
My Launcher icon is a different icon, which works fine
To initiate the notification, I send a curl request to https://fcm.googleapis.com/fcm/send with the following json:
{
"to":"device_token",
"priority":"high",
"notification":{
"title":"New Notification!",
"body":"Test",
"sound":"default",
"click_action":"FCM_PLUGIN_ACTIVITY",
"icon": "icon" //optional piece
},
}
A icon.png is present in all android/res/mipmap*
directories.
Also, I have added the following meta in my AndroidManifest.xml reference
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/icon" />
Also, I have tried to read logcat from the device. Whenever I have passed icon param in the json that I post to fcm, I see the following log
06-12 23:43:38.457 22257 22303 W FirebaseMessaging: Icon resource icon not found. Notification will use default icon.
But whenever I don't pass the icon in the json, I dont see the above message in logcat.
I think I am missing a simple thing somewhere but not able to figure it out Please help me with some pointers, guidance on where i may be wrong
Thanks in advance