重复的APN令牌 [英] APNs duplicate tokens

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

问题描述

我们必须持有几种不同应用程序的数据(设备令牌)推送通知服务器。随着苹果希望停止使用UDID作为标识符的人,我一直在寻找到改变这种服务器,以便它不依赖于UDID的了,不能再识别设备。

我明白的APN返回的令牌是不是全球唯一,但每个装置相当独特。然而,通过我们的数据库中去的时候,我注意到,有其中的同样的道理的用于的不同的设备

所以我试图找出是什么导致这一点。在这一点上,我看到了两种方式:


  1. 有一个在我们的服务器注册处理一个不起眼的错误的地方

  2. 苹果回收这些设备令牌(可能是一个设备复位后?)。我们总是存储某个设备注册的最后时间,我注意到,有始终与同样不同设备之间的注册至少数天。据我所知,没有任何记号是的同时的使用不同的设备。

我真的AP preciate,如果有人可以提供一些线索这一点。


解决方案

我们知道的是,<一个href=\"http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW2\"相对=nofollow>苹果告诉我们使用设备令牌来推送通知到设备。所以,只要你是:


  1. 查询的APN,每一次新的设备令牌应用程序启动并在数据库中注册它


  2. 查询非活动设备反馈服务,并从数据库中清除它们


......你在做什么苹果希望你做的。

不过,我怀疑有可能是您的注册code错误,因为100 / 750K是pretty高冲突率。考虑到这些设备令牌用于推送通知,很多​​人会抱怨收到通知不属于他们的...

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.

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. 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.

解决方案

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. Querying the APNs for a new device token every time the application is launching and registering it in your database

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

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

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...

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

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