苹果推送通知令牌随iOS更新而改变吗? [英] Does apple push notification token change with iOS update?

查看:300
本文介绍了苹果推送通知令牌随iOS更新而改变吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PhoneGap开发iOS应用程式。我使用PhoneGap推送通知插件来集成推送通知。所以,当用户在我的数据库中启动应用程序时,我记录了用户ID和通知令牌ID。最近我意识到有多个令牌ID为同一个用户。

I am developing the iOS app with PhoneGap. I used the PhoneGap push notification plugin to integrate push notification. So, when user start the app in my database I have recorded the user id and the notification token id. Recently I have realized that there are multiple token ID's for same user.

我想知道是因为iOS更新。 (最近他们发布了几个更新iOS 7.0,7.0.1,7.0.2等..)

I'm wondering is this because of the iOS updates. (Recently they have release the several updates iOS 7.0, 7.0.1, 7.0.2 etc..)

任何人都可以确认这一点吗?

Can anyone please confirm this? And also if this is not the case can anyone give me some idea or possible reason to change APNS token?

感谢

推荐答案

是的,安装新的iOS版本会更改设备的设备令牌。即使在iOS7之前也是如此。

Yes, installing a new iOS version changes the device token of the device. That was true even prior to iOS7.

此外,我读到,从iOS7开始,每个应用程序都为同一设备获取一个唯一的设备令牌case为pre iOS7版本),但为了向后兼容性,旧设备令牌仍然工作(直到您开始发送消息与新的设备令牌)。这将解释您的用户收到重复的邮件。

In addition, I read that starting in iOS7, each application gets a unique device token for the same device (which wasn't the case for pre iOS7 versions), but for backward compatibility, the old device token still works (until you start sending messages with the new device token). That would explain your users getting duplicate messages.

您应该处理设备的设备令牌更改的情况。由于您已有用于识别用户的用户ID,因此您可以轻松确保为每个用户保留单个设备令牌。

You should handle the case in which the device token of a device changes. Since you already have a user ID to identify the user, you can easily make sure that you keep a single device token for each user.

这篇关于苹果推送通知令牌随iOS更新而改变吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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