Anton Ivinskyi
Anton Ivinskyi

Reputation: 392

Send firebase cloud message aka push notification to multiple, more then 3 topics, at a time

I'm trying to find a way to send messages to multiple topics using firebase cloud messages. I see in the docs that there is a way to send to a field condition instead of field to and I can write a condition

'TopicA' in topics || 'TopicB' in topics || 'TopicC' in topics

but there is a constraint

Conditions for topics support two operators per expression

Which means I can only send a message up to three topics at once. Is there a way to send a message to more then 3 topics at a time?

Upvotes: 6

Views: 1909

Answers (1)

morepork
morepork

Reputation: 983

The limit is 3 topics, you can send to more via multiple send requests, e.g. send to "a || b || c", then to "d || e || f".

By doing this some users might receive the same message twice, e.g. if they're in both topic "a" and "d", so you would need to handle this in your app.

Upvotes: 2

Related Questions