Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count subscribers of a topic in Firebase Cloud Messaging

What I want to do with my app is this: users can select different interests and as soon as there are more than ~5 people interested in the same thing, I want to send them a notification.

I thought Firebase + Topics would be a good choice for this.

But how do I find out how many people have subscribed to a topic?

like image 544
Butterkekskrumel Avatar asked Nov 28 '16 18:11

Butterkekskrumel


People also ask

Is there any limit for Firebase Cloud Messaging?

Maximum message rate to a single device For Android, you can send up to 240 messages/minute and 5,000 messages/hour to a single device.


1 Answers

U can use this to get number of subscribers :

  • Go to the Firebase Console "https://console.firebase.google.com/"
  • Under Grow, click Cloud Messaging.
  • Open up your developer tools.
  • Click New Notification and type some title and message
  • On Target Tab , click on Topic
  • In the network tab in developer tool 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}

Copy as a curl. Use that to get subscribers list enter image description here

Reference: https://gist.github.com/timrijckaert/218be90541a7285e21455fafa2962dea

like image 81
Lakeesh Anand AN Avatar answered Sep 30 '22 11:09

Lakeesh Anand AN