Firebase Cloud Messaging - having multiple topics - no duplicate messages

I was looking through the documentation for Firebase Cloud Messaging (FCM) and I was wondering if anyone had this problem.

I have a feed where users can sometimes have several overlapping topics that you can subscribe to. for example #News, #Weather may be in a weather event message.

The example shows news or weather checks ("News" in the "Weather" topics by topic) by topic

My question is whether FCM will simply choose the first option that it will meet, for example. News and messages of people with the tag "news", or he will also send the same message twice - creating a duplicate? (1 for news for the user, then 1 for weather).

Thanks in advance! Kiran

+1
source share
1 answer

A simple test should be able to understand this. Relevant users will receive only one message. The FCM server processes the request depending on the condition, in this case you used the OR condition, which means that as soon as one of the conditions becomes true (in your scenario, the first condition is if the signed token is signed before News ), then the server will send a notification in accordance with the usual and ignores other conditions.

PS: I tested this before publishing, so I'm sure of the behavior.

+2
source

All Articles