I am sending push notification with firebase from nodejs server.
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-
{body:demo body,e:1,title:demo title}
Here is no badge property.
IOS receives badge count under aps
key. You probably sharing JSON of alert itself which is under aps
as well.
Normal Payload
"aps" : {
"alert" : {
"title" : "Game Request",
"subtitle" : "Five Card Draw",
"body" : "Bob wants to play poker",
}
}
with badge
"aps" : {
"alert" : {
"title" : "Game Request",
"subtitle" : "Five Card Draw",
"body" : "Bob wants to play poker",
},
"badge":9
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.