3

Documentation for topic messages for FCM says the following two points

enter image description here

Just wanted to know what is this excessive number of topics? Any approximate value to it? Also, the documentation doesn't say anything about creation of topics. How to create/delete a topic?

Another question -

Document says it takes time to show the topic on firebase console, so, we can't send notifications unless the topic is visible on firebase console (even programmatically)?

Thanks in advance

Vishal Sharma
  • 2,550
  • 1
  • 23
  • 40

1 Answers1

6

For future questions, please limit yourself to a single question per post. But here are the answers that I know (or a fairly educated guess):

  1. The limit on the number of topics a client can subscribe to is to counter abuse. It is not a documented value.
  2. A topic is auto-created when a client subscribes to it.
  3. There is no API to delete a topic. It will automatically disappears when nobody is subscribed to it anymore.
  4. You can only send notifications from the console once the topic shows up. You can send notifications from your app server using the Firebase Cloud Messaging API at any moment.
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Apologies @Frank. Thanks for your answers! – Vishal Sharma Jul 03 '16 at 16:05
  • 1
    You mentioned "Counter abuse" in The limit on the number of topics a client can subscribe, what do you mean by this ? what is the maximum number of topics a single user can subscribe??? – Prashanth Mar 22 '17 at 11:24
  • 1
    Is there any limit on how many unique topics that can be created? ex: Each user will have one unique topic. If number of users increases to millions does it still support? – SkyTreasure Oct 30 '17 at 06:29
  • See https://stackoverflow.com/questions/37830098/topics-on-firebase-cloud-messaging – Frank van Puffelen Oct 30 '17 at 06:49
  • 1
    Removed the point about not being able to delete a subscription. You can delete a topic by performing an HTTP DELETE using the topic id. See "Delete Push Subscriptions" at: https://developers.google.com/instance-id/reference/server – Johann Jun 18 '18 at 13:22
  • 1
    The maximum number of topics per app instance is 1999. See: https://stackoverflow.com/a/48334967/753632 – Johann Jun 18 '18 at 13:29
  • @AndroidDev The documentation you linked is to delete a subscription, not to delete a topic itself. I'm reverting your edit. – Frank van Puffelen Jun 18 '18 at 14:23
  • @FrankvanPuffelen Actually you can delete a topic indirectly by bulk deleting the subscriptions: https://stackoverflow.com/a/37650817/753632 – Johann Jun 18 '18 at 18:17
  • I added a note to clarify that. – Frank van Puffelen Jun 18 '18 at 18:55