APNs 重复令牌 [英] APNs duplicate tokens

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

问题描述

我们有一个推送通知服务器,用于保存多个不同应用程序的数据(设备令牌).由于 Apple 希望阻止人们使用 UDID 作为标识符,我正在考虑更改此服务器,使其不再依赖 UDID 来识别设备.

We have a push notification server which holds the data (device tokens) for several different applications. With Apple wanting to stop people using the UDID as identifier, I was looking into changing this server so that it does not rely on UDIDs to identify devices any longer.

我了解 APN 返回的令牌不是全局唯一的,而是每个设备唯一的.然而,在浏览我们的数据库时,我注意到有几种情况(750k+ 注册时有几百个)相同的令牌用于不同的设备.

I understand that the tokens returned by APNs are not globally unique, but rather unique per device. However, when going through our database, I noticed that there are several cases (a few hundred on 750k+ registrations) where the same token is used for different devices.

所以我试图找出导致这种情况的原因.在这一点上,我看到了两种可能性:

So I'm trying to figure out what's causing this. At this point, I see 2 possibilities:

  1. 我们的服务器注册处理中存在一个隐晦的错误
  2. Apple 会回收这些设备令牌(可能在设备重置后?).我们总是存储某个设备上次注册的时间,我注意到使用相同令牌的不同设备的注册之间总是至少有几天的时间.据我所知,没有不同设备同时使用的令牌.
  1. There is an obscure bug in our server registration handling somewhere
  2. Apple recycles these device tokens (perhaps after a device reset?). We always store the last time a certain device registered, and I noticed that there are always at least several days between registrations of different devices with the same token. As far as I can tell, there are no tokens that are concurrently used by different devices.

如果有人能对此有所了解,我将不胜感激.

I would really appreciate it if someone could shed some light on this.

推荐答案

我们所知道的是 Apple 告诉我们使用设备令牌向设备推送通知.所以,只要你是:

What we know is that Apple tells us to use the Device Token to push notifications to a device. So, as long as you are:

  1. 每次应用程序启动并在您的数据库中注册时,查询 APNs 以获取新的设备令牌

  1. Querying the APNs for a new device token every time the application is launching and registering it in your database

查询不活动设备的反馈服务并将它们从您的数据库中清除

Querying the Feedback service for inactive devices and purging them from your database

...你正在做苹果希望你做的事情.

... you are doing what Apple is expecting you to do.

但是,我确实怀疑您的注册码中可能存在错误,因为 100/750k 是一个相当高的冲突率.考虑到这些设备令牌用于推送通知,很多人会抱怨收到不属于他们的通知......

However, I do suspect that there may be a bug in your registration code because 100/750k is a pretty high conflict rate. Considering these device tokens are used to push notifications, a lot of people would be complaining about receiving notifications that don't belong to them...

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

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