重复的 Apple APNS 推送通知? [英] Duplicate Apple APNS push notifications?

查看:45
本文介绍了重复的 Apple APNS 推送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一段时间以来,我们一直在我们的应用上使用 APNS,没有发生太多事故,突然我们的用户报告多次收到相同的推送通知.

We've been using APNS on our app without much incident for some time now, and suddenly our users are reporting receiving the same push notification multiple times.

我已经非常乏味地确认,我们的服务器只向 Apple 发送一次通知负载,但通知会在横幅和通知中心生成 2 个,有时甚至 3 个相同的警报.

I've confirmed - tediously - that our servers are only sending the notification payloads to Apple once, and yet the notification produces 2 and sometimes 3 identical alerts, both in the banner and notification center.

这已在 iOS5 和 iOS6 中观察到.

This has been observed in both iOS5 and iOS6.

有人见过这种现象吗?我是否可能错过了一些向有效负载添加唯一标识符以防止 Apple 向设备发送重复通知的机会?Google 的 C2DM 有用于此类事情的 collapse_key,但我在 APNS 中找不到类似功能的参考.

Has anybody seen this phenomenon before? Am I perhaps missing some opportunity to add a unique identifier to the payload that will prevent Apple from sending duplicate notifications to the device? Google's C2DM has collapse_key for this sort of thing, but I can find no reference to a similar functionality in APNS.

推荐答案

你能重现这个问题吗?如果它不是生产服务器,您应该尝试向通知添加标识符.还要检查用户是否在您的数据库中没有多次登录.例如.使用 Twitter、Facebook 和密码等,并且都具有相同的设备令牌.

Are you able to replicate this issue? You should try and add identifiers to notification if it's not a productions server. Also check if user doesn't have mutiple logins in your database. For eg. With twitter, Facebook and password etc and all have same device token.

前一段时间遇到了类似的问题,我发现这些用户在他们的手机上除了最终版本之外还有多个版本的 Beta iOS 固件,这导致 Apple 服务器多次向同一设备 ID 发送相同的通知.

Had a similar issue some time back and digging deep I found that these users had multiple editions of beta iOS firmware on their phone beside final version and this was causing apple servers to send same notification to Same device ID mutiple times.

有些博客有针对消费者的说明,而我们能做的却很少.

Some blogs have instructions for consumers out there and very litte we could do.

这篇关于重复的 Apple APNS 推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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