使用Firebase通知的灰色正方形作为通知图标 [英] Grey square as notification icon using Firebase notifications

查看:678
本文介绍了使用Firebase通知的灰色正方形作为通知图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Firebase Cloud Messaging集成到我的android应用中.但是,当应用程序在后台或关闭时,Firebase通知将显示为灰色正方形图标,而不是我的应用程序的启动器图标.

I am attempting to integrate Firebase Cloud Messaging into my android app. But when the app is in the background or closed, Firebase notification is displayed with grey square icon instead of my application's launcher icon.

在不实现Firebase服务器API和发送数据消息的情况下,如何使通知图标成为我的应用程序徽标?

How could I make the notification icon to be my application logo, without implementing Firebase server API and sending data messages?

推荐答案

在Firebase 9.8.0中,可以通过在清单中添加有关此图标的信息来更改此图标:

From Firebase 9.8.0 it is possible to change this icon, by adding info about this in Manifest:

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

示例,您将在这里找到

https://github.com. com/firebase/quickstart-android/blob/master/messaging/app/src/main/AndroidManifest.xml

这篇关于使用Firebase通知的灰色正方形作为通知图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆