FCM将通知推送到多个主题

时间:2019-02-26 08:16:38

标签: firebase firebase-cloud-messaging

我的项目有1个问题,我的确有SubscribeToTopic(),已成功向“ TopicA”和“ TopicB”发送了1条消息,如下所示:

chart.getDescription().setEnabled(false);

但是当我发送多个主题时:

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

所有响应均成功

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

但没有人收到。我如何向2、3,...主题发送消息。以及我如何查看历史记录中的任何消息,我的帐户是免费的。谢谢大家

1 个答案:

答案 0 :(得分:0)

我想您应该将条件属性替换为:

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

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