1. <i id='IXxEW'><tr id='IXxEW'><dt id='IXxEW'><q id='IXxEW'><span id='IXxEW'><b id='IXxEW'><form id='IXxEW'><ins id='IXxEW'></ins><ul id='IXxEW'></ul><sub id='IXxEW'></sub></form><legend id='IXxEW'></legend><bdo id='IXxEW'><pre id='IXxEW'><center id='IXxEW'></center></pre></bdo></b><th id='IXxEW'></th></span></q></dt></tr></i><div id='IXxEW'><tfoot id='IXxEW'></tfoot><dl id='IXxEW'><fieldset id='IXxEW'></fieldset></dl></div>
        <bdo id='IXxEW'></bdo><ul id='IXxEW'></ul>

    2. <legend id='IXxEW'><style id='IXxEW'><dir id='IXxEW'><q id='IXxEW'></q></dir></style></legend>
    3. <tfoot id='IXxEW'></tfoot>

    4. <small id='IXxEW'></small><noframes id='IXxEW'>

        计算 Firebase 云消息传递中某个主题的订阅者

        时间:2023-07-30
        <legend id='WiICq'><style id='WiICq'><dir id='WiICq'><q id='WiICq'></q></dir></style></legend>
      1. <small id='WiICq'></small><noframes id='WiICq'>

        <tfoot id='WiICq'></tfoot>
          <bdo id='WiICq'></bdo><ul id='WiICq'></ul>

            <i id='WiICq'><tr id='WiICq'><dt id='WiICq'><q id='WiICq'><span id='WiICq'><b id='WiICq'><form id='WiICq'><ins id='WiICq'></ins><ul id='WiICq'></ul><sub id='WiICq'></sub></form><legend id='WiICq'></legend><bdo id='WiICq'><pre id='WiICq'><center id='WiICq'></center></pre></bdo></b><th id='WiICq'></th></span></q></dt></tr></i><div id='WiICq'><tfoot id='WiICq'></tfoot><dl id='WiICq'><fieldset id='WiICq'></fieldset></dl></div>

                  <tbody id='WiICq'></tbody>

                1. 本文介绍了计算 Firebase 云消息传递中某个主题的订阅者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想对我的应用做的是:用户可以选择不同的兴趣,并且一旦有超过 5 人对同一事物感兴趣,我想向他们发送通知.

                  What I want to do with my app is this: users can select different interests and as soon as there are more than ~5 people interested in the same thing, I want to send them a notification.

                  我认为 Firebase + Topics 将是一个不错的选择.

                  I thought Firebase + Topics would be a good choice for this.

                  但是我如何知道有多少人订阅了一个主题?

                  But how do I find out how many people have subscribed to a topic?

                  推荐答案

                  没有可用的 API 来检查一个主题有多少订阅者.(查看我的回答这里)

                  There is no available API to check how many subscribers a topic has. (see my answer here)

                  您必须在服务器端实现映射,保存主题名称并添加到订阅者列表中.订阅后,添加新订阅者,检查计数(看看它是否在您的首选数字内),然后触发通知.

                  You'll have to implement the mapping on your server-side, saving the name of the topics and adding in the list of subscribers. Upon subscription, add the new subscriber, check the count (see if it's within your preferred number), then trigger a notification.

                  这篇关于计算 Firebase 云消息传递中某个主题的订阅者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:辅助应用程序的 FirebaseMessaging.getInstance(firebaseApp) 应该是公共的,但它 下一篇:FirebaseInstanceIdService getToken 返回 null

                  相关文章

                  <small id='J7HQ4'></small><noframes id='J7HQ4'>

                  1. <tfoot id='J7HQ4'></tfoot>

                  2. <i id='J7HQ4'><tr id='J7HQ4'><dt id='J7HQ4'><q id='J7HQ4'><span id='J7HQ4'><b id='J7HQ4'><form id='J7HQ4'><ins id='J7HQ4'></ins><ul id='J7HQ4'></ul><sub id='J7HQ4'></sub></form><legend id='J7HQ4'></legend><bdo id='J7HQ4'><pre id='J7HQ4'><center id='J7HQ4'></center></pre></bdo></b><th id='J7HQ4'></th></span></q></dt></tr></i><div id='J7HQ4'><tfoot id='J7HQ4'></tfoot><dl id='J7HQ4'><fieldset id='J7HQ4'></fieldset></dl></div>
                    • <bdo id='J7HQ4'></bdo><ul id='J7HQ4'></ul>

                      <legend id='J7HQ4'><style id='J7HQ4'><dir id='J7HQ4'><q id='J7HQ4'></q></dir></style></legend>