ios – 创建生命周期唯一ID的替代方法

我想为iPhone / ipad设备创建UDID,这将保持不变,所以请告诉我,如果有人有想法?

搜索google和stack-overflow,但没有解决方案.

还有一些建议使用OpenUDID和CFUUID,但是当用户删除并重新安装应用程序时,CFUUID会不同.但是我想为每个应用程序使用相同的UDID,这将在第一次生成,并且每个应用程序的每个设备的使用寿命应该保持不变.

解决方法

编辑2

由于iOS升级,并且根据新文档,标识符FORvendor不会保留应用程序重新安装的价值.我在this link看到答案.这可能以一种或另一种方式帮助.只是要注意,即使系统重置,UDID也将保留,所以即使系统重置,寻求终身UDID的开发人员也可能会遇到这个答案.除此之外,提到的答案似乎很有用.

还要看summary here.

identifierForvendor可从UIDevice Class Reference.开始

The value of this property is the same for apps that come from the
same vendor running on the same device.

[[UIDevice currentDevice] identifierForvendor].UUIDString

注意:iOS 6.0及更高版本中可用.

编辑1根据UIDevice Class Reference的新版本

The value in this property remains the same while the app (or another
app from the same vendor) is installed on the iOS device. The value
changes when the user deletes all of that vendor’s apps from the
device and subsequently reinstalls one or more of them. Therefore,if
your app stores the value of this property anywhere,you should
gracefully handle situations where the identifier changes.

编辑

我希望你能在this popular link看到

1)MAC CFBundleIdentifier的MD5

[[UIDevice currentDevice] uniquedeviceidentifier]

每个应用程序仍然保持不变,但每个应用程序不同.如果您删除并重新安装应用程序,则每个应用程序都会相同.

2)MAC的MD5

[[UIDevice currentDevice] uniqueGlobaldeviceidentifier]

对于所有来自同一设备的应用,这一点将保持不变.如果您删除并重新安装应用程序,则每个设备将相同.

编辑3

注意:iOS7中的此解决方案不再有用,因为iOS7不再可用uniqueIdentifier.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...