简体   繁体   English

如何组合通知 Flutter FirebaseMessaging

[英]How to combine notifications Flutter FirebaseMessaging

Hi I was wondering if there is a way in which I could use Firestore messaging and flutter to merge notifications such similar to how instagram does it.嗨,我想知道是否有一种方法可以使用 Firestore 消息传递和 flutter 来合并通知,类似于 instagram 的做法。 Where initially it will say a single person liked a post etc then if more like the post it will merge it by saying bob, garry and 42 others liked a post.最初它会说一个人喜欢一个帖子 etc 然后如果更喜欢这个帖子,它将通过说 bob、garry 和其他 42 个人喜欢一个帖子来合并它。 I have an image below which I hope makes the objective more clear我在下面有一张图片,希望能让目标更清晰在此处输入图像描述

Those are so-called collapsible messages .这些就是所谓的可折叠消息 From the Firebase documentation:来自 Firebase 文档:

A collapsible message is a message that may be replaced by a new message if it has yet to be delivered to the device.可折叠消息是可以被新消息替换的消息,如果它还没有被传递到设备。

A common use cases of collapsible messages are messages used to tell a mobile app to sync data from the server.可折叠消息的常见用例是用于告诉移动应用从服务器同步数据的消息。 An example would be a sports app that updates users with the latest score.一个例子是一个体育应用程序,它用最新的分数更新用户。 Only the most recent message is relevant.只有最近的消息是相关的。

So in the example of Instagram messages, when somebody likes the same post, the server sends a new message that replaces the previous message, by specifying the same collapse_key .因此,在 Instagram 消息的示例中,当有人喜欢同一个帖子时,服务器会通过指定相同的collapse_key发送一条替换先前消息的新消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM