![](/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.