Reputation: 3189
The way I see it, this should be a common use case. For example I have 3 users who subscribe to following topic(s)
The current problem is when I tried to send notification with message "Man Utd won 5-0" for both topics "CNN" and "Sports", the 3rd user (User C) will actually get 2 same notification.
What kind of logic should I put in the backend to ensure the 3rd user will get only 1 notification ?
Upvotes: 0
Views: 103
Reputation: 598817
What you want can be done with an OR
condition like this:
"('CNN' in topics || 'Sports' in topics)"
This message will be deliver to any user that is subscribed to CNN
, to Sports
, or to both.
For a more complete example and explanation see the Firebase documentation on sending messages to topics.
Upvotes: 1