简体   繁体   English

IOS 应用程序中未收到 Firebase 推送通知徽章计数

[英]Firebase push notification badge count is not being received in IOS app

I am sending push notification with firebase from nodejs server.我正在从 nodejs 服务器发送带有 firebase 的推送通知。

the message payload is like this.消息负载是这样的。

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

In IOS app I received this as-在 IOS 应用程序中,我收到了这个 -

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

Here is no badge property.这里没有徽章属性。

IOS receives badge count under aps key. IOS 在aps键下接收徽章计数。 You probably sharing JSON of alert itself which is under aps as well.您可能正在共享也在aps下的警报本身的 JSON。

Normal Payload正常负载

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

with badgebadge

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM