用于唯一ID生成的iOS硬件参数 [英] iOS hardware parameters for unique id generation

查看:169
本文介绍了用于唯一ID生成的iOS硬件参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我想使用任何设备硬件参数为iOS设备生成唯一ID。我不想使用MAC地址,因为MAC地址也有可能被更改。所以,如果有任何其他独特的硬件参数可以生成一个唯一的ID,请告诉我。

Hi I would like to generate an unique id for an iOS device using any of the device hardware parameters. I do not want to use the MAC address because there is a chance that the MAC address can also be changed. So can you please let me know if there is any other unique hardware parameter with which I can generate an unique ID.

推荐答案

我相信的内容是UUID普遍接受的替代品。

I believe something along the lines of this is the generally accepted replacement for UUID.

简而言之,您需要创建一个CFUUID,然后将其存储在iOS设备上的Keychain中,即使您卸载该应用程序也会存在。按照这些方式写了我自己的实现(显然不是我链接的那个),我还没有遇到任何真正的问题。甚至可以在您制作的其他应用中访问它,只要您使用与您的应用相同的安全参数来访问它。

In short, you need to create a CFUUID, and then store it in the Keychain on the iOS device, which persists even if you uninstall the app. Having written my own implementation along those lines (not the one I've linked to, obviously), I've yet to come across any real problems with this. It can even be accessed in your other apps that you make, so long as you access it with the same security parameters in aloof your apps.

这篇关于用于唯一ID生成的iOS硬件参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆