ios - 在某些情况下,UUID 是否会发生变化

标签 ios icloud uuid keychain uniqueidentifier

我正在使用用户的设备 UUID 来获取唯一的设备。

NSString  *currentUUIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

我知道如果应用程序被删除/重新安装 ( Apple document ),UUID 会发生变化。

但是 UUID 是否会在以下情况下发生变化?

  1. 如果应用已更新。 (找到same question)
  2. 如果设备操作系统版本已经升级。
  3. 如果做 iCloud/iTunes 备份和恢复。
  4. 如果设备已重置。 (在这种情况下,我认为 UUID Keychain 存储将不起作用。我猜钥匙串(keychain)存储也会被清除。)

编辑:

不,这不是重复的,question与如何唯一标识设备有关,我已经关注了。我知道我们可以使用 UUID 来唯一标识设备。但我担心的是 UUID 可能更改的频率是多少,如果更改,那么它可以更改的场景是什么。

最佳答案

The device's identifierForVendor is an excellent way of identifying the device. It will change if the app (and all apps from the same developer) is removed from the device and reinstalled. It does not depend on wifi/Bluetooth connections. With the exception of a bug last year, it does not change with operating systems. ...... You could also write your own UUID to the keychain - that survives delete/reinstall of the app...You could also write something to the user's iCloud key-value file. That would be user-specific rather than device-specific. It also survives delete/reinstall. I think that is what you want.

关于ios - 在某些情况下,UUID 是否会发生变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31115848/

相关文章:

ios - 如何检测设备上的 iCloud 帐户是否已更改?

uuid - HardwareIdentification.GetPackageSpecificToken API 在 Windows 10 中发生了变化

python - 如何使用 SQLAlchemy 在 Postgres 数据库中创建包含 UUID 列的表?

ios - 使用未解析的标识符 'Messaging' 、 'MessagingDelegate' 、 'MessagingRemoteMessage'

iphone - 同一数据的不同 View 之间转换的概念

ios - 自定义 UIDynamicBehavior : how do I know the total number of animation steps/ticks?

java - 如何通过蓝牙查询远程手机是否支持PBAP?

ios - 我如何创建一个 iOS CAAnimation 并自己定义每个插值?

objective-c - 删除应用后的 iOS 应用持久化设置

ios - 在 iCloud 中存储 >1MB 数组的最佳方式?