我正在使用用户的设备 UUID
来获取唯一的设备。
NSString *currentUUIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
我知道如果应用程序被删除/重新安装 ( Apple document ),UUID
会发生变化。
但是 UUID
是否会在以下情况下发生变化?
- 如果应用已更新。 (找到same question)
- 如果设备
操作系统版本
已经升级。 - 如果做
iCloud/iTunes
备份和恢复。 - 如果设备已重置。 (在这种情况下,我认为
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/