我正在从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在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
}