简体   繁体   English

Apple推送通知服务设备令牌

[英]Apple push notification service device token

I am utilizing the apple push notification service in my application. 我在我的应用程序中使用apple推送通知服务。 I know that the device token sent from Apple server is unique for a device. 我知道从Apple服务器发送的设备令牌对于设备是唯一的。 If I uninstall my app and install it again register for push service,will this device token remain the same for that device for the same app? 如果我卸载我的应用程序并再次安装它注册推送服务,那么该设备令牌对于同一个应用程序的设备是否保持不变? How does Apple generate a device token for a device? Apple如何为设备生成设备令牌?

Quoted from Apples Local and Push Notification Programming Guide 引自Apples Local和Push Notification Programming Guide

By requesting the device token and passing it to the provider every time your application launches, you help to ensure that the provider has the current token for the device. 通过每次启动应用程序时请求设备令牌并将其传递给提供程序,您可以帮助确保提供程序具有设备的当前令牌。 If a user restores a backup to a device other than the one that the backup was created for (for example, the user migrates data to a new device), he or she must launch the application at least once for it to receive notifications again. 如果用户将备份还原到创建备份的设备之外的设备(例如,用户将数据迁移到新设备),则他或她必须至少启动一次应用程序才能再次接收通知。 If the user restores backup data to a new device or reinstalls the operating system, the device token changes. 如果用户将备份数据还原到新设备或重新安装操作系统,则设备令牌会更改。 Moreover, never cache a device token and give that to your provider; 此外,永远不要缓存设备令牌并将其提供给您的提供商; always get the token from the system whenever you need it 始终在需要时从系统获取令牌

Okay, First, if you uninstall and reinstall your app that device token won't be changed. 好的,首先,如果您卸载并重新安装应用程序,则不会更改设备令牌。 Device token only changed from you reinstall Device iOS and register your device ( reset for all new ). 设备令牌仅在您重新安装设备iOS时更改并注册您的设备(重置所有新设备)。 So, when users just reinstall the app, that device token won't be changed. 因此,当用户只是重新安装应用程序时,该设备令牌将不会被更改。 This's my experience. 这是我的经历。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM