iphone推送通知徽章编号增量

时间:2021-11-05 19:45:21

How to increment the badge number and how to know whether the user opens the notifications.so v could know whether to increment the badge no or to start from the beginning(as 1).

如何增加徽章编号以及如何知道用户是否打开通知。因此v可以知道是否增加徽章否或从头开始(如1)。

here

alertNotification.Payload.Badge = 1;

1 个解决方案

#1


7  

You cannot increment or decrement badge number using push-notifications. You can only set NEW value!

您无法使用推送通知增加或减少徽章编号。您只能设置新值!

You can know current badge value only if your application is now running.

只有当您的应用程序正在运行时,您才能知道当前徽章值。

If you extremely want to add such feature you should store current user's badge value at your server and send appropriate value with your push-notification.

如果您非常想添加此类功能,则应将当前用户的徽章值存储在服务器上,并使用推送通知发送相应的值。

P.S. It's very strange that Apple didn't think about it when they were developing badge numbers and push-notifications. =(

附:很奇怪Apple在开发徽章编号和推送通知时并没有考虑到这一点。 =(

#1


7  

You cannot increment or decrement badge number using push-notifications. You can only set NEW value!

您无法使用推送通知增加或减少徽章编号。您只能设置新值!

You can know current badge value only if your application is now running.

只有当您的应用程序正在运行时,您才能知道当前徽章值。

If you extremely want to add such feature you should store current user's badge value at your server and send appropriate value with your push-notification.

如果您非常想添加此类功能,则应将当前用户的徽章值存储在服务器上,并使用推送通知发送相应的值。

P.S. It's very strange that Apple didn't think about it when they were developing badge numbers and push-notifications. =(

附:很奇怪Apple在开发徽章编号和推送通知时并没有考虑到这一点。 =(