iOS上的重复推送通知

iOS上的重复推送通知

问题描述:

此问题可能是一样的复制苹果的APNS推送通知?,但因为这一次没有得到答案,我有一些更多的信息,我会尝试再次问吧。

This question is probably the same as Duplicate Apple APNS push notifications?, but since that one didn't get an answer, and I have some more information, I'll try to ask it again.

步骤来重现问题:


  • 设置通知中心显示通知提醒如,这会使问题更加明显。

  • 确保应用程序没有在前台运行。

  • 发送3个相同的推通知快速连续。

  • 等到的消息在手机到达,你现在将不得不关闭提醒3次。

  • 现在,送1多个通知,这是不符合previous的人是相同的。

  • 您现在得到最后的通知,但你也将获得previous通知显示出来一次之一。这就是问题所在。

  • 如果您继续发送单一的通知,第3的人会不断弹出时,它不应该。

下面是按照这些步骤,这清楚地表明了问题的视频:

Here is a video that follow these steps, which clearly shows the problem:

http://youtu.be/TSqt8S4FY6w

我们刚刚为雷米大风的确在链接的问题上面确信,我们的通知以正确的方式通知每发送,只有一次。我们还与这两个沙箱,APNS和生产测试APNS此,既表现如出一辙。

We have just as Remy Gale did in the linked question above made sure that our notifications are sent in the correct way, and only once per notification. We have also tested this with both the sandbox-apns and the production-apns, both behave exactly the same.

如果应用程序徽章设置为0,这反过来将删除通知中心所有通知中的问题就消失了。手动删除通知,并没有帮助。

The problem disappears if the app-badge is set to 0, which in turn removes all notifications from notification center. Removing the notifications manually doesn't help.

UIApplication *app = [UIApplication sharedApplication];
app.applicationIconBadgeNumber = 0;

但是,这不是一个解决方案。

But that isn't a solution.

问题不会出现在所有通知包含独特的文字。添加GUID到警报文本会使问题消失。它添加到APNS有效载荷为自定义属性或作为本地化参数但是不会帮助,所以这也是没有办法了。

The problem doesn't appear if all notifications contain unique text. Adding a GUID to the alert-text will make the problem disappear. Adding it to the apns-payload as a custom property or as a localized argument will however not help, so this is also not a solution.

这可能会很少发生在生产环境中与实时应用程序,但它可能发生,而当它,它是为用户真烦!

This will probably rarely happen in a production environment with a live app, but it can happen, and when it does, it is really annoying for the users!

有谁知道为什么出现这种情况?有没有人有一个可行的解决方案?

Does anyone know why this happen? Does anyone have a viable solution?

谷歌集团一>针对Gmail已经从谁已经研究了错误了一下,包括一个可能的解决方法用户的条目。根据条目的错误是不是在iOS 5的present但与iOS 6中推出。

This Google Group for Gmail has an entry from a user who has researched the bug a bit and includes a possible workaround. According to the entry the bug is not present in iOS 5 but was introduced with iOS 6.

解决方法是简单地追加零宽不连字的随机数标题为了保证唯一性。

The workaround is simply appending a random number of Zero-width non-joiner to the title in order to assure uniqueness.