isuru
isuru

Reputation: 3565

Is it possible to send Firebase push notification to specific token and also to the topic

I want to send push notifications by specifying device-token and also a specific Topic. Is it possible to do this using Firebase admin-SDK? The documentation specifies Topics and device-token methods separately but no clear definition to use both methods together.

admin.messaging().sendToDevice(tokens, payload)
admin.messaging().sendToTopic("TOPIC", payload)

Upvotes: 0

Views: 717

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 600110

There is no API (neither in the Admin SDK, nor in the REST API that is uses under the hood) to send messages to both topics and a set of tokens with a single call.

The closest I can think of is to have those devices subscribe to a secondary token, and then using an OR condition to send to both topics.

Upvotes: 1

Related Questions