服务器可以找出哪些消息主题有订阅者吗? [英] Can a server find out which message topics have subscribers?

查看:28
本文介绍了服务器可以找出哪些消息主题有订阅者吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务器应用程序有没有办法通过 FCM 发送主题消息来找出哪些主题实际上有订阅者?

Is there a way for server application that sends topic messages over FCM to find out which topics actually have subscribers?

我们可能有大量主题,并且希望避免总是向所有主题推送消息,因为在任何给定时间只有一个子集会处于活动状态.我知道服务器可以查询特定 InstanceID 订阅的主题,但迭代数千个主题听起来是个坏主意.

We have potentially large number of topics and would like to avoid having to always push messages to all of them since only a subset would be active at any given time. I know that server can query about particular InstanceID's subscribed topics, but iterating over thousands of them sounds like a bad idea.

我们可以推出自己的解决方案,但由于该信息已经存在于 Firebase 本身中,因此最好从那里获取.

We can roll our own solution, but since that information already exists in Firebase itself, it would be preferred to just get it from there.

推荐答案

没有.当前没有查询主题订阅者数量的方法,您必须在应用服务器上维护令牌和主题之间的关系.

No. There is no current way to query the number of subscribers to a topic, you would have to maintain the relationship between token and topics on you app server.

这篇关于服务器可以找出哪些消息主题有订阅者吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆