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.
Thank you @Jaluanda, your fixed worked perfectly 😊
@Aulig you're right.
How do you know only the __Secure-1.. is missing ? If see many info in the original cookie header, is there a way to gen all of them ? 😅
Here is the error triggered :
Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.