Home > Back-end >  FCM, How to make all users in group to subscribe to topic
FCM, How to make all users in group to subscribe to topic

Time:09-15

I'm making a social media app like Facebook using Flutter and Firebase.

I'm using Firebase Cloud Messaging to make notification service.

I want to make users who joined community or groups to subscribe their group's topic. Therefore, I can send notification to them by using method which is "subscribeToTopic()". However, I don't know how to make all users in community or groups to subscribe to certain topics.

If you know how to make all users to subscribe to certain topics, please let me know. Thank you!

CodePudding user response:

There is no API to get the current subscribers to a topic, nor is there an API that verbatim subscribes all subscribers to one topic to another topic.

If you already track group membership yourself, you can either let each client subscriber themselves to the additional topic, or you can determine the list of tokens for the group members and then subscribe them to the topic on the server.

  • Related