Maximum number of topics on Google Cloud Messaging

2019-02-18 14:33发布

I want to avoid the complexities of managing Device Tokens at the application level

  1. One user using multiple devices on iOS and Android
  2. Multiple users subscribed to an application group

Treating #1 and #2 as topics on GCM is obviously an easy solution. So that I only have to deal with my Application UserIds and GroupIds while sending notifications.

1) When device is registering (iOS/Android), I just subscribe the device to topics ["USER_A", "GROUP_A", "GROUP_B"]

2) When sending a notification, just send to a topic.

However, that means, number of topics = users + groups.

1 million users + 500K groups = 1.5 million topics on GCM

My question is..

  1. Is there any limit to the number of topics on GCM?
  2. Is there a better approach to avoid managing device subscriptions without having to deal with its complexities when delivering messages.

2条回答
虎瘦雄心在
2楼-- · 2019-02-18 15:01

For #1:

Nope. As per their blog last December 2015:

We’re now happy to announce that we’re allowing unlimited free topics for your app. This means app developers can place an unlimited number of devices within each topic and create an unlimited number of topics.

As far as I know, there still hasn't been any changes with regards to the number of topics.

For #2:

I think it pretty much depends on your preference. For your use case in #1, I think that Device Group Messaging is the one to use. But since you're aiming to avoid too much complication, I think what you did using Topic Messaging is pretty much it. I actually found this post that kinda discusses what to use between the two, the comments are very enlightening, if you will. :D

Cheers! :)

查看更多
霸刀☆藐视天下
3楼-- · 2019-02-18 15:01

GCM has removed the limitations on Topics as well as subscriptions FCM also supports the same Check This: https://firebase.google.com/docs/cloud-messaging/android/topic-messaging

查看更多
登录 后发表回答