FCM topic limits and expiration/invalidation of old unused topics?

前端 未结 1 650
萌比男神i
萌比男神i 2021-01-26 13:22

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 ex

1条回答
  •  旧时难觅i
    2021-01-26 14:08

    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.

    0 讨论(0)
提交回复
热议问题