Long Doan
Long Doan

Reputation: 13

FCM Push notifications to multiple topics

I has 1 issue with my project, i did subscribeToTopic(), has been successfully send 1 message to 'TopicA' and 'TopicB' like this:

var message = {
    data: {
      title: "title",
      body: "body"
    },
    condition: "'TopicA' in topics"
}

but when i send multi topics:

var message = {
    data: {
      title: "title",
      body: "body"
    },
    condition: "'TopicA' in topics && 'TopicB' in topics" or "'TopicA' in topics || 'TopicB' in topics"
}

all response success

"status": true,
"message": "success",
"data": "projects/{project_name}/messages/5670594709975500395"

but nobody received. How can i send message to 2, 3, ... topics. And how i view any message in history, my account is free. Thanks all

Upvotes: 1

Views: 1134

Answers (1)

Diego Velasco
Diego Velasco

Reputation: 36

I guees you should replace condition attribute this:

condition: "'TopicA' in topics && 'TopicB' in topics" or "'TopicA' in topics || 'TopicB' in topics"

to

condition: "'TopicA' in topics || 'TopicB' in topics"

Upvotes: 2

Related Questions