Skip to content

How can I subscribe to topic? #565

Answered by FamilyMan
FamilyMan asked this question in Q&A
Discussion options

You must be logged in to vote

There is no client-side API in the JavaScript SDK to subscribe to a topic. You'll instead need to use a (server-side) Admin SDK to accomplish this.

For example, the subscribeToTopic method you refer to exists in the Node.js SDK and in the Java SDK, but not in the JavaScript/Web or Android SDKs.

I recommend studying the documentation on subscribing a web client to a topic a bit further: https://firebase.google.com/docs/cloud-messaging/js/topic-messaging#subscribe_the_client_app_to_a_topic

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JTibblesSoftcon
Comment options

Answer selected by FamilyMan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants