简体   繁体   English

如何使用pushNotification在phonegap中的iOS应用中显示徽章?

[英]How to display badges in iOS app in phonegap with pushNotification.?

In push notification.java i had give payload.setBadge(1); 推送通知 payload.setBadge(1);我给了payload.setBadge(1); when I push message it set's the badge value to 1. Again when i push message it is setting to 1. It is not incrementing the value. 当我推送消息时,将徽章值设置为1。再次当我推送消息时,将其徽章设置为1。它不会增加值。 I had written the incremental code in iOS native code 我已经用iOS本机代码编写了增量代码

[UIApplication sharedApplication].applicationIconBadgeNumber
numberOfBadges+badges;

The value as given in the push notification is always displayed. 推送通知中给出的值始终显示。 It will not increment. 它不会增加。 You will need to keep track of badge value server side and push the correct value. 您将需要跟踪徽章价值服务器端并推送正确的价值。

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

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