Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 430
Anton Ivinskyi Avatar asked Jun 01 '16 13:06

Anton Ivinskyi


1 Answers

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.

like image 142
morepork Avatar answered Oct 06 '22 05:10

morepork