The folder projectroot>/res/native/android/res/
+1, I do not understand where to put the android notification_icon (and colors.xml)
My notification_icons are in this route:
platforms/android/res/drawable-sizeX/notification_icon.png
Yeah, mine too, but still not working. Doesn't appear the icont that I've set.
Try setting your icon in the request, like this:
{
"notification" : {
"title" : "title",
"body" : "body",
"color" : "#1f295d",
"sound":"default",
"icon" : "notification_icon" <--------
},
"to": "eobfSAiF",
"priority" : "normal"
}
If your app shows a white square instead of your icon check this: https://clevertap.com/blog/fixing-notification-icon-for-android-lollipop-and-above/
i've tried it too. I add the xmls files at the folders values and values-v21, and i've set the notification_icon.png into the folders in drwables folders, but when i trigger the notification just appear the white square.
And this link it's not working.
https://clevertap.com/blog/fixing-notification-icon-for-android-lollipop-and-above/
@kelvinludwig The link works for me.
since you use firebase notification message(not pure data message), onMessageReceived will not call when the app is in the background,
so for this kind of notification , you should use
\
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="drawable/ic_stat_ic_notification" \/\>
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="color/colorAccent" \/\>
at AndroidManifest.xml
see https://firebase.google.com/docs/cloud-messaging/android/client
and https://firebase.google.com/docs/cloud-messaging/android/receive
@ml454 yes
check in the comment in the FirebasePluginMessagingService
````
// [START_EXCLUDE]
// There are two types of messages data messages and notification messages. Data messages are handled
// here in onMessageReceived whether the app is in the foreground or background. Data messages are the type
// traditionally used with GCM. Notification messages are only received here in onMessageReceived when the app
// is in the foreground. When the app is in the background an automatically generated notification is displayed.
// When the user taps on the notification they are returned to the app. Messages containing both notification
// and data payloads are treated as notification messages. The Firebase console always sends notification
// messages. For more see: https://firebase.google.com/docs/cloud-messaging/concept-options
// [END_EXCLUDE]
````
Most helpful comment
since you use firebase notification message(not pure data message), onMessageReceived will not call when the app is in the background,
so for this kind of notification , you should use
at AndroidManifest.xml
see https://firebase.google.com/docs/cloud-messaging/android/client
and https://firebase.google.com/docs/cloud-messaging/android/receive