Reputation: 21
I've been trying to change the notification icon of the Firebase Cloud notifications in Unity.
I tried copying the icon folder structure from the sample at https://github.com/firebase/quickstart-android/tree/master/messaging/app/src/main to Assets/Plugins/Android/Res
so I can test with icons that are known to work, and modifying my Manifest with the
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_stat_ic_notification"/>
tag.
However it still keeps using the app icon, also when using the default_notification_color tag used in the sample the notifications don't change.
Upvotes: 1
Views: 1339
Reputation: 21
Solved by removing the meta-data from the manifest, so only having the icon in the res folder in the app. Then referencing the icon via the notification JSON:
{
"to": "<Key>",
"collapse_key": "type_a",
"notification": {
"body": "Body of Your Notification",
"title": "Title of Your Notification",
"icon": "notification_icon_name",
"color": "#0000C0"
}
}
This properly showed the icon and changed the color when the status bar was opened.
Upvotes: 1