如何设置由Image Base Studio生成的通知图标供Firebase使用?

问题描述 投票:0回答:1

在集成firebase之后,我注意到通知图标是白色/灰色方块,因此我使用Image Asset Studio生成了一个通知图标,如本指南中所述:

https://developer.android.com/studio/write/image-asset-studio.html#create-notification

通知图标是这个(它是白色的,选择图像并下载它以查看它):

enter image description here

正如您所看到的,它遵循规则,并且它位于向导默认存储它的位置,可绘制密度......等

问题是,当我从firebase启动PUSH时,通知图标仍然是白色/灰色方块,因此出现问题并且没有使用该图标进行通知。

还有什么需要自动将该图标应用于通知吗?

android firebase push-notification firebase-notifications notification-icons
1个回答
1
投票
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/ic_stat_ic_notification" />

这将转到覆盖默认图标的AndroidManifest文件。

如果需要覆盖默认通知颜色:

<meta-data android:name="com.google.firebase.messaging.default_notification_color"
    android:resource="@color/google_blue" />
© www.soinside.com 2019 - 2024. All rights reserved.