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

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

问题描述

我使用 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.

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

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.

所以我的问题是,我应该在之后再次取消订阅所有代币,让 FCM 知道它不再使用,还是这样做毫无意义?(以防他们进行了某种清理)

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.

推荐答案

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

无限制.

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

当有至少 1 个订阅者时创建一个主题,当没有更多订阅者时它也会自动删除.

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

这个用例本身似乎没有错.这有点不合常规(尽管我很确定我之前曾提出过类似的建议).

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).

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

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天全站免登陆