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

我正在使用用户的设备UUID来获取唯一的设备.
NSString  *currentUUIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

我知道如果应用程序被删除/重新安装(Apple document),UUID会被更改.

但UUID是否因以下情况而改变?

>如果应用已更新. (发现same question)
>如果设备操作系统版本已升级.
>如果做iCloud / iTunes备份和恢复.
>如果设备已重置. (在这种情况下,我认为UUID 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.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...