【问题标题】:Firebase push notification badge count is not being received in IOS appIOS 应用程序中未收到 Firebase 推送通知徽章计数
【发布时间】:2021-02-15 22:58:59
【问题描述】:

我正在从 nodejs 服务器发送带有 firebase 的推送通知。

消息负载是这样的。

const notificationObjNew: any = {
        notification: {
            body: "demo body",
            title: "demo title",
            badge : "100",
        },
        topic: notificationTopic
    };

在 IOS 应用程序中,我收到了这个 -

{body:demo body,e:1,title:demo title}

这里没有徽章属性。

【问题讨论】:

    标签: ios node.js firebase push-notification firebase-cloud-messaging


    【解决方案1】:

    IOS 在aps 键下接收徽章计数。您可能也共享aps 下的警报本身的 JSON。

    正常负载

    "aps" : {
          "alert" : {
             "title" : "Game Request",
             "subtitle" : "Five Card Draw",
             "body" : "Bob wants to play poker",
          }
       }
    

    badge

    "aps" : {
          "alert" : {
             "title" : "Game Request",
             "subtitle" : "Five Card Draw",
             "body" : "Bob wants to play poker",
          },
          "badge":9
       }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-21
      • 1970-01-01
      • 2012-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-14
      • 2013-08-07
      相关资源
      最近更新 更多