iPhone:增量徽章自动计数器 [英] iPhone: Increment badge counter automatically

查看:306
本文介绍了iPhone:增量徽章自动计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/1942605/push-notification-badge-auto-increment\">Push-Notification徽章自动递增。

我已经实现推送通知我的iPhone应用程序。每当我得到的消息,我想通过一个增加值徽章,所以我不需要它传递推送通知的有效载荷。这可能吗?

I have implemented Push Notification for my iPhone application. Whenever I get the message, I want to increment badge value by one so I need not to pass it in Push Notification payload. Is it possible?

我才知道,我必须要管理,从服务器端,所以这是唯一的方法吗?我不得不存储在数据库的previous价值,并获得最后的值,每当我发出下一条消息?不是苹果支持此类似自动收到时推送通知递增application.applicationIconBadgeNumber。

From here I learnt that I have to manage that from server side, so that's the only way? I had to store the previous value in Database and get the last value whenever I send next message? Isn't Apple support this automatically like incrementing application.applicationIconBadgeNumber whenever Push Notification received.

从服务器端管理证件号码的问题是,如果用户已经看到了previous推送通知信息时,你就错送证件号码!

The problem with managing Badge number from server side is if user has already seen the previous Push Notification message, you would send wrong badge number!

推荐答案

这不是一个真正的问题。客户只需要让服务器知道它已经看到的消息。别人都在做,所以才学会如何做到这一点,做到这一点。

It's not really a problem. The client just needs to let the server know what messages it has seen. Everyone else is doing it, so just learn how to do it and do it.

编辑::您可以通过设置徽章柜台:

You can set the badge counter using:

[UIApplication sharedApplication].applicationIconBadgeNumber = badgeCount;

你做的每一次,你应该 badgeCount 发送到服务器,让服务器知道当前计数。

Every time you do, you should send badgeCount to the server, so that the server knows the current count.

这篇关于iPhone:增量徽章自动计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆