Home > database >  Send a FCM by combinations of topic and device tokens
Send a FCM by combinations of topic and device tokens

Time:01-07

I'm trying to handle the use case that the user can turn on/off to receive notification from many scenarios.

I imaged that every scenario is a topic. I'm using go sdk and i saw that the Message struct have both Token and Topic. So does it mean that i can send a FCM by a combinations of a topic and list of device tokens ?

CodePudding user response:

As far as I know there is no way to combine tokens and topics in a single request to the FCM API to send a message. The closest you can get is making a batched request, with one request for the topic(s) and one or more for the tokens.

To allow the user to turn off display of notifications, consider sending data messages (rather than notification messages that are auto-displayed) and then handling the display or non-display of those message in your client-side application code.

  • Related