问题描述
我正在尝试将 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 开始,可以通过在 Manifest 中添加相关信息来更改此图标:
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" />
您可以在此处找到示例:
Example you will find here:
https://github.com/firebase/quickstart-android/blob/master/messaging/app/src/main/AndroidManifest.xml
这篇关于使用 Firebase 通知作为通知图标的灰色方块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)