Firebase 通知图标为灰色

alp*_*hin 5 push-notification firebase firebase-realtime-database flutter firebase-cloud-messaging

虽然我在stackoverflow中做了这个解决方案,但图标仍然是一样的。

    <meta-data   android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/ic_launcher" />
Run Code Online (Sandbox Code Playgroud)

这里是顶部图标:

在此输入图像描述

当我滑动顶部栏时,我看到这个: 在此输入图像描述

哪里有问题?我还使用此网站创建透明图标:https://jgilfelt.github.io/AndroidAssetStudio/icons-notification.html#source.space.trim=1&source.space.pad=0&name=ic_stat_ic_launcher

我的 res 文件现在也是这样(来自上面链接的可绘制文件夹):

在此输入图像描述

图标在这里: 在此输入图像描述

Vol*_*mar 10

就我而言,问题是我将

\n

<meta-data android:name="com.google.firebase.messaging.default_notification_icon" \xe2\x80\xa6 />

\n

<activity/>AndroidManifest.xml 中主标签下的标签

\n

显然,它应该位于<application/>标签下(层次结构中较高的位置)。

\n

  • 天哪,c&amp;%p 就是这样。太感谢了。就这一堆浪费了一天的时间。 (2认同)

bha*_*ats 3

用于通知的图标必须是白色且背景透明,否则将显示灰色框。

您可以查看这篇文章以了解更多信息。

我遇到了同样的问题,并通过更改图标图像解决了它。

这是一个示例图像: 通知标志