Grey square as notification icon using Firebase notifications(使用 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 开始,可以通过在 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 通知作为通知图标的灰色方块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 Firebase 通知作为通知图标的灰色方块
- UITextView 内容插图 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- URL编码Swift iOS 2022-01-01
