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.
Streaming from the REST API To get started with streaming, we will need to do the following: Set the client's Accept header to text/event-stream. Respect HTTP Redirects, in particular HTTP status code 307. Include the auth query parameter if the Firebase database location requires permission to read.
From your client side using email and password creds to login to firebase. Note if you are using REST for login then your login url is of the form (googleapis.com/identitytoolkit/v3/relyingparty/…). May be its better to create a separate question so that others can leverage as well!
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.
I just copy Answer from same question here becuase this page is first result in google: Get all subscribed topics from firebase cloud messaging
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
There is no public API to get the list of topics for Firebase Cloud Messaging
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With