FCM主题限制以及旧的未使用主题的到期/失效? [英] FCM topic limits and expiration/invalidation of old unused topics?

查看:92
本文介绍了FCM主题限制以及旧的未使用主题的到期/失效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用FCM主题已有一段时间了,但是文档非常有限,并且大多数搜索都指向相同的页面,所以我在这里问我,希望有人对此主题有足够的经验来回答我的问题. /p>

我想知道允许的主题数是否有限制,不再使用的主题会发生什么变化?我的意思是,主题何时会失效?

我遇到了退订主题似乎不起作用的问题,即使我得到了肯定的答复,或者其他时候通知已发送两次.

要解决这个问题,我当前正在制作一个新命令,但是与以前不同,每次运行该命令时,我都会将令牌订阅到唯一的主题,发送通知,取消订阅令牌,然后该主题将永远不会使用再次.这是我可以更好地控制哪些用户订阅了某些主题的一种方法,因为FCM对此没有帮助,我知道.

因此,我的问题是,此后我是否应该再次取消订阅所有令牌,让FCM知道它已不再使用,或者这样做毫无意义? (以防他们进行某种清理)

希望有人可以指引我正确的方向.

解决方案

我想知道允许的主题数量是否有限制...

没有限制.

...不再使用的主题会发生什么?我的意思是,什么时候主题无效?

在至少有1个订阅者的情况下会创建一个主题,在没有更多订阅者的情况下也会自动将其删除.

为了解决这个问题,我目前正在制作一个新命令,但是与以前不同,每次运行该命令时,我都会将令牌订阅到唯一的主题,发送通知,取消订阅令牌,然后该主题将再也不会使用了.这是我可以更好地控制哪些用户订阅了某些主题的一种方法,因为FCM对此没有帮助,我知道.

这个用例本身似乎并没有错.只是有点不合常规(尽管我敢肯定我之前曾建议过类似的东西).

当前,在FCM v1中,不再建议使用registration_ids参数(用于发送到多个令牌-每个请求1000个). FCM团队似乎正朝着使用主题发送到多个令牌的方向迈进.话虽如此,恕我直言,我认为用例是有效的.

I have been using FCM topics for a while now, but the documentation is very limited and most searches leads to the same pages, so I am asking here, in hope someone has enough experience on the subject to answer my questions.

I am wondering if there is a limit to how many topics are allowed and what happens to topics that are no longer in use? I mean, when will a topic be invalid?

I have had issues where unsubscribing from a topic didn't seem to work, even if I get a positive response back or other times the notifications have been sent twice.

To get around this, I am currently making a new command, but unlike before, every time the command is run, I will subscribe tokens to a unique topic, send the notification, unsubscribe token and then that topic will never be used again. This is a way for me to have better control over which users gets subscribed to certain topics, as FCM offers no help with this, that I am aware of.

So here my question is, should I unsubscribe all the tokens again afterwards, letting FCM know that it is no longer in use, or would that be pointless to do? (In case they have some sort of clean up in place)

Hope someone can guide me in the right direction.

解决方案

I am wondering if there is a limit to how many topics are allowed...

No limit.

...what happens to topics that are no longer in use? I mean, when will a topic be invalid?

A topic is created when there is at least 1 subscriber and it also gets automatically deleted when there are no more subscribers.

To get around this, I am currently making a new command, but unlike before, every time the command is run, I will subscribe tokens to a unique topic, send the notification, unsubscribe token and then that topic will never be used again. This is a way for me to have better control over which users gets subscribed to certain topics, as FCM offers no help with this, that I am aware of.

This use case doesn't seem to be wrong per se. It's just a bit unconventional (although I'm pretty sure I suggested something like this before).

Currently, with FCM v1, the registration_ids parameter (used to send to multiple token -- 1000 each request) is no longer advised. FCM team seems to be moving towards using topics for sending to multiple tokens. With that said, IMHO, I think the use case is valid.

这篇关于FCM主题限制以及旧的未使用主题的到期/失效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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