Reputation: 517
recently I started getting this type of error in production when registering to some topics:
Invalid registration response :'Error=TOO_MANY_SUBSCRIBERS'. It is missing 'token' field.
I'm using the following method on iOS Platform to register the device to a topic:
Messaging.messaging().subscribe(toTopic: String, completion: ((Error?) -> Void))
Environment:
- FirebaseMessaging (7.0.0):
- FirebaseCore (~> 7.0)
- FirebaseInstanceID (~> 7.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
- GoogleUtilities/Environment (~> 7.0)
- GoogleUtilities/Reachability (~> 7.0)
- GoogleUtilities/UserDefaults (~> 7.0)
The error suggests that firebase has a limit on the number of subscriptions to the topic, is this?
Upvotes: 0
Views: 2011
Reputation: 9139
There is no limit on subscribers per topic, as well there is no limit on number of created topics per project.
There is a limit how fast client apps can be subscribed or unsubscribed from a topic - 3000 queries per second.
It looks like too many users are trying to subscribe to the topic, implement a retry logic.
Upvotes: 0
Reputation: 71
According to the Firebase docs, FCM has no total topic subscriptions limit, but a 2000 subscriptions per app instance limit.
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.
Upvotes: 4