![](/img/trans.png)
[英]How to remove the notification badge count in react-native-firebase/messaging after opening the app
[英]How to setup badge count firebase push notification in ios?
我已成功设置后端以使用“firebase-admin”发送通知。 但是,我无法为我的 ios 设置徽章计数。 我目前正在使用 react native 和 node.js typescript 作为后端。
发送时我的后端管理员如下所示:
const payload = {
notification: {
title: "title",
body: `body`,
//badge: 1 this throws an error
},
token: receiverFcmToken
};
try{
await admin.messaging().send(payload).then((response) => {
console.log("success);
});
} catch(err){
console.log(err);
}
任何帮助,将不胜感激。 谢谢
您的有效负载应如下所示:
const payload = {
notification: {
title: "title",
body: `body`,
},
apns: {
payload: {
aps: {
badge: 1,
},
},
},
token: receiverFcmToken
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.