【问题标题】:FCM Push notifications to multiple topicsFCM 向多个主题推送通知
【发布时间】:2019-07-19 17:33:30
【问题描述】:

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

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"
}

全部响应成功

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

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

【问题讨论】:

    标签: firebase firebase-cloud-messaging


    【解决方案1】:

    我猜你应该替换条件属性:

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

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

    【讨论】:

      猜你喜欢
      • 2017-11-08
      • 1970-01-01
      • 2018-03-22
      • 2021-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-09
      相关资源
      最近更新 更多