Firebase云消息传递 - 具有多个主题 - 无需重复邮件

时间:2018-01-31 15:23:13

标签: node.js firebase firebase-cloud-messaging

我一直在浏览Firebase云消息传递(FCM)的文档,我想知道是否有人遇到同样的问题。

我有一个Feed,用户有时可以拥有多个可以订阅的重叠主题。例如#News,#天气可能在关于天气事件的帖子中。

给出的示例检查新闻或天气     (主题中的'新闻'|主题中的|'天气')主题

我的问题是,FCM会选择它遇到的第一个选项,例如。带有“新闻”标签的新闻和消息人,或者它也会发送两次相同的消息 - 创建副本? (1表示用户的新闻,1表示天气)。

提前致谢! 基兰

1 个答案:

答案 0 :(得分:2)

A simple test should be able to figure this out. The corresponding users would only receive one message. The FCM server processes the request depending on the condition, in this case, you were using an OR condition -- meaning, as soon as one of the conditions becomes true (in your scenario, the first condition is if the token is subscribed to News), then the server would send the notification as per usual and would ignore the other conditions.

PS: I tested this out before posting, so I'm positive of the behavior.