-
Apparently firebase can use something like:
How can I subscribe to a topic using this module? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 |
Beta Was this translation helpful? Give feedback.
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