1

I have to use FCM to receive push notifications on my web application. Now I want to subscribe to a particular topic from the web app. Is there any way to do this? if yes then is it safe the safe way to do?

Or subscribe to a topic should be done from server side?

Aju John
  • 2,214
  • 1
  • 10
  • 27

1 Answers1

3

The client-side web SDK for Firebase Cloud Messaging does not support subscribing to topics. If you want to subscribe your web clients to FCM topics, you will have to do so from server-side code, either through the Admin SDK or through the corresponding REST APIs.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thanks @Frank. So the only way to do is from server side. – Aju John Jun 03 '19 at 16:49
  • I don't see server-side subscribing tokens with Rest-API mentioned in the docs: https://firebase.google.com/docs/cloud-messaging/manage-topics. The docs mentions it can only be done with the Admin SDK 'The Firebase Admin SDK allows you to perform basic topic management tasks from the server side.'. Is it still possible with Rest-API? – J. Doe Dec 31 '20 at 16:22