简体   繁体   English

将 iOS 操作系统更新到较新版本后,设备令牌是否会更改?

[英]Does device token change after update iOS OS to newer version?

Few of my device have stopped receiving push notification after updating the device to newer iOS version.将设备更新到更新的 iOS 版本后,我的设备中很少有停止接收推送通知。 So, My question is, Does device token change after update iOS OS to newer version?所以,我的问题是,将 iOS 操作系统更新到较新版本后,设备令牌是否会发生变化? and I need to update my device token on my server too.我也需要在我的服务器上更新我的设备令牌。

Apple Documentation says that we should generate device token every time application launches. Apple 文档说我们应该在每次应用程序启动时生成设备令牌。

  func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {}

This method get called everytime when application launches and here you need to send device token to server.每次应用程序启动时都会调用此方法,在这里您需要将设备令牌发送到服务器。 So it doesn't matter if token changes or not.因此,令牌是否更改都没有关系。 Apple Push notification server will be aware of new token and should send notification to right device . Apple Push 通知服务器将知道新令牌并应将通知发送到正确的设备。

And you should never use device token for some kind of device identification.而且您永远不应该将设备令牌用于某种设备标识。

This is what original documentation says :这就是原始文档所说的:

Important: Never cache device tokens in local storage.重要提示:切勿在本地存储中缓存设备令牌。 APNs issues a new token when the user restores a device from a backup, when the user installs your app on a new device, and when the user reinstalls the operating system.当用户从备份恢复设备、用户在新设备上安装您的应用程序以及用户重新安装操作系统时,APNs 会发出一个新令牌。 If you ask the system to provide the token each time, you're guaranteed to get an up-to-date token.如果您每次都要求系统提供令牌,则保证您会获得最新的令牌。

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

相关问题 苹果是否允许为iOS应用程序强制更新到较新版本? - Does Apple allows force update to newer version for iOS Applications? iOS 推送通知设备令牌是否会更改? - Does a iOS Push notification device token change? 设备令牌是否会随着OS的升级而改变? - Does the device token change ever on up gradation of OS? Xcode 12.4 iPhone iOS 更新 14.7 后的“不支持的操作系统版本” - Xcode 12.4 “Unsupported OS version” after iPhone iOS update 14.7 请将设备还原到下面列出的操作系统版本,或更新到最新版本的iOS SDK - Please restore the device to a version of the OS listed below, or update to the latest version of the iOS SDK 获取连接到PC的ios设备的os版本 - get the os version of the ios device connected to the PC 在解析iOS中的安装表中更新设备令牌 - Update device token in installation table in parse ios 当较新的 iOS 应用程序版本已经发布时,如何更新较旧的 iOS 应用程序版本? - How to update an older iOS app version when a newer one is already out? React Native 中是否有适用于 Android 和 iOS 的唯一标识符,即使在重置或升级操作系统后也不会改变 - Is there a unique identifier for and Android and iOS available in React Native which does not change even after resetting or upgrading OS 应用更新后将文件保留在iOS设备上 - Keep File on iOS Device after App Update
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM