I want to retrieve all the topics created so far via API request, similar to the list that firebase console display. See the image attached.

- 565,676
- 79
- 828
- 807

- 8,558
- 10
- 54
- 79
-
1visit this link. http://stackoverflow.com/questions/37987821/get-all-subscribed-topics-from-firebase-cloud-messaging it is list out some topics. – Krunal Goswami Nov 25 '16 at 13:05
-
I am wondering why this was marked as duplicated questions. The created topic list is different to the subscribed topic list from a specific mobile device. – Tran Ho Apr 30 '20 at 14:26
3 Answers
I just copy Answer from same question here becuase this page is first result in google: Get all subscribed topics from firebase cloud messaging
you can do it through a GET request
HTTP GET Request
https://iid.googleapis.com/iid/info/<TOKEN>?details=true
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
TOKEN in url : FirebaseInstanceId.getInstance().getToken();
key : can be found in [firebase console][1]: Your project -> settings -> Project settings -> Cloud messaging -> Server Key

- 6,808
- 3
- 37
- 47
There is no public API to get the list of topics for Firebase Cloud Messaging

- 565,676
- 79
- 828
- 807
-
-
10Documentation for a product typically tells you what that product *can* do. A list of all the things a product *can't* do would be rather long. – Frank van Puffelen Jun 18 '16 at 13:56
-
-
@HishamMuneer could you give a description of the use-case you face that would be helped by having a "list-topics" endpoint? – Arthur Thompson Jun 18 '16 at 15:28
-
1@ArthurThompson I want to display a list of topics out of which user can check/uncheck to opt in. – Hisham Muneer Jun 18 '16 at 15:39
-
1@HishamMuneer seems like a reasonable use-case, but since topics are created automatically once your clients subscribe to them, then you can assume the existence of them and let your users opt in (subscribe) and if the topic exists fine, if not it will be created. I get that this is a bit of a work around so I agree that it would be reasonable to have a method to list current topics. – Arthur Thompson Jun 18 '16 at 15:46
-
@ArthurThompson Lets say I have 2 users - userA and userB. And to every user I have to display two options 1. textbox to create a topic, 2. list of already created topics by all users in which s/he can opt in. If userA created a topic "topicX" and userB created "topicY", how can they see each other's topics. Right now I am handling this by maintaining the list of all topics on my own server. Try posting a question on SO and put the appropriate tags, ya I can create a new tag on SO but if SO doesn't show me the list of tags already created by other users, things will go crazy. – Hisham Muneer Jun 19 '16 at 06:29
-
2@FrankvanPuffelen I just saw that you are an engineer at Firebase, Do you believe my problem of getting all topics list is legit(read the above comment), if yes, when this can be resolved by Firebase? – Hisham Muneer Jun 19 '16 at 06:43
The way I got around this was using the firebase database, first create a topics folder inside the database, then add entries into this folder when a user creates a new topic.
You then create a function within the app to retrieve all entries in this folder within the database.
Now you can allow the user to select a pre existing topic from the results of the database and then use that to call your subscribe function.
Not a solid solution for all but worked for me.

- 133
- 12