使用mipmap时通知不显示图标

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

我正在处理FCM并添加这些元数据以在我使用mipmap图标不起作用并显示实心矩形时为Notification定义图标和颜色当我使用可绘制图像时,它正在显示

    <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" />

带有mipmapwith  mipmap

带有可绘制的

with drawable

android push-notification android-drawable android-mipmap
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.