【问题标题】:Notification not show icon in case of using mipmap使用 mipmap 时通知不显示图标
【发布时间】:2020-05-04 09:53:56
【问题描述】:

我正在处理 FCM 并添加这些元数据来定义通知的图标和颜色,当我使用 mipmap 图标时它不起作用并显示填充矩形 当我使用可绘制图像时,它正在显示

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@mipmap/ic_launcher" />
    <meta-data
        android:name="com.google.firebase.messaging.default_notification_color"
        android:resource="@color/colorPrimary" />




    <meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@drawable/map_hot" />
    <meta-data
        android:name="com.google.firebase.messaging.default_notification_color"
        android:resource="@color/colorPrimary" />

使用 mipmap

可绘制

【问题讨论】:

    标签: android push-notification android-drawable android-mipmap


    【解决方案1】:

    问题是通知图标必须有透明背景more explanation

    解决方案: 如果您没有设计师,您可以使用 此链接Image to transparent 获取具有透明背景的图像,然后您使用它来获取所有可绘制尺寸 get image drawables

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多