简体   繁体   English

Flutter 通知显示为阴影/灰色

[英]Flutter Notification shows as shadow/gray

I'm using Firebase as my notification handler and the notification image works well with IOS. For some reason, in some android devices the notification image appears to show the shape of the logo but just gray.我使用 Firebase 作为我的通知处理程序,通知图像与 IOS 配合使用效果很好。出于某种原因,在某些 android 设备中,通知图像似乎显示徽标的形状,但只是灰色。

So far this is what I've tried:到目前为止,这是我尝试过的:

  1. Used mipmap and drawable as my meta-data resource in the AndroidManifest.xml在 AndroidManifest.xml 中使用 mipmap 和 drawable 作为我的元数据资源

  2. Created /android/app/src/main/res/raw/keep.xml创建/android/app/src/main/res/raw/keep.xml

    <?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@drawable/*" />

  3. Ensured that the notification image is transparent.确保通知图像是透明的。

The icon to be used for notifications must be white-colored and with transparent background else it will show a grey-colored box.用于通知的图标必须是白色和透明背景,否则它将显示一个灰色框。

for more help check this article https://medium.com/nonstopio/change-the-firebase-notification-icon-in-a-flutter-245b7f7dc546如需更多帮助,请查看这篇文章https://medium.com/nonstopio/change-the-firebase-notification-icon-in-a-flutter-245b7f7dc546

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM