This little script will output the amount of tokens subscribed to a topic.
You will need to replace the variables with your personal ones in order for it to work.
We used this function in a Lambda which sends the results to a monitoring dashboard.
Screenshots in the comments.
-
Go to the Firebase Console.
-
Under Grow click Cloud Messaging.
-
Open up your developer tools.
-
Typ in a fake notification text
-
Click Next
-
Under the Target tab click Topic
-
In the network tab you will see a request to an url similar to this one
https://gcmcontextualcampaign-pa.clients6.google.com/v1/4/projects/${projectId}/topics?prefix=%2Ftopics%2F&key=${key} -
Save your projectId and key in the script
-
Still in the developer tools, under the Application tab go to Cookies
-
Click on the https://console.firebase.google.com site
-
Here you will find the SID, HSID, SSID, APISID and the SAPISID
-
Save these in the script.
I think it's broken these days without the __Secure-1**** cookies. Unfortunately __Secure-1PSIDTS expires very quickly (roughly 10 mins), so it's impractical to keep extracting the cookies.