Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many topics an app instance can subscribe in FCM?

As mentioned in FCM documents, unlimited topic can be created for one Firebase application. But as the Firebase Admin SDK document: explains an error:

messaging/too-many-topics:- A registration token has been subscribed to the maximum number of topics and cannot be subscribed to any more.

I was not able to find this threshold value of maximum number of topics. Can anybody explain, what is the limit? How many topics an app instance can subscribe to in FCM?

like image 430
Arun Chaudhary Avatar asked Jan 18 '18 13:01

Arun Chaudhary


2 Answers

I found the answer by running a subscription script for an app instance. After subscribing to 1999 topics, for the next subscription it started giving error: messaging/too-many-topics.

So the threshold value is 1999.

like image 118
Arun Chaudhary Avatar answered Sep 30 '22 00:09

Arun Chaudhary


As much as the selected answer is correct, I'll like to post an absolute answer here. Google Firebase Cloud Messaging

Some things to keep in mind about topics:

  • Topic messaging supports unlimited subscriptions for each topic. However, FCM enforces limits in these areas:

  • One app instance can be subscribed to no more than 2000 topics.

  • If you are using batch import to subscribe app instances, each request is limited to 1000 app instances.

  • The frequency of new subscriptions is rate-limited per project. If you send too many subscription requests in a short period of time, FCM servers will respond with a 429 RESOURCE_EXHAUSTED ("quota exceeded") response. Retry with exponential backoff.

like image 44
maswerdna Avatar answered Sep 29 '22 23:09

maswerdna