Group Firebase FCM on Android Device(在 Android 设备上分组 Firebase FCM)
问题描述
我正在尝试使用 Firebase 控制台发送云消息.我正在为 android 设备执行此操作.
I am trying to send cloud messages using the Firebase console. I am doing this for android device.
推送通知与随其发送的数据一起显示在设备上.
The push notifications do appear on the device fine along with the data sent with it.
但每个通知都会单独显示.这意味着如果我发送 3 个通知,通知栏中会显示三个项目.
But each notification shows up on its own. Meaning if I send 3 notifications three items show up in the notification bar.
我想要实现的是将所有通知分组在一个标题下.正如您在 WhatsApp 或 Facebook 中所做的那样.
What I want to achieve is that all the notifications to be grouped under one heading. As you have in WhatsApp or Facebook.
如何使用 Firebase 控制台实现这一点?
How can this be achieved using the Firebase Console?
推荐答案
分组通知,你的意思是 stacking 还是 捆绑通知?
By grouping the notification, do you mean stacking or bundling notifications?
如果是这样,这实际上取决于您在客户端应用程序中处理通知的方式.您只需使用 setGroup() 将所有通知添加到单个组,然后调用 notify() 来让 NotificationManager 进行更改.
If so, this is actually depends on how you handle notifications in your client app. You simply have to make use of the setGroup() to add all your notifications to a single group then calling notify() to let the NotificationManager of the changes.
这个将每个通知添加到组 文档很漂亮很多总结了这一切.
This Add Each Notification to a Group documentation pretty much sums it all up.
这篇关于在 Android 设备上分组 Firebase FCM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Android 设备上分组 Firebase FCM
基础教程推荐
- AdMob 广告未在模拟器中显示 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
