iphone - 每部 iPhone/iPod Touch 是否都有唯一的 ID?

标签 iphone cocoa-touch privacy

每台 iPhone/iPod Touch 是否都有像 Mac 地址一样的唯一 ID?

我是否必须请求用户授予传输此类唯一 ID 的权限?

最佳答案

是的,您可以使用 UIDevice 的 uniqueIdentifier 属性来获取它:

A unique device identifier is a hash value composed from various hardware identifiers such as the device’s serial number. It is guaranteed to be unique for every device but cannot publically be tied to a user account. You can use it, for example, to store high scores for a game in a central server or to control access to registered products. The unique device identifier is sometimes referred to by its abbreviation UDID.

编辑: uniqueIdentifier 属性在 iOS5 中已弃用,您现在不应使用它。作为替代方案,您可以生成自己的唯一 ID(例如检查 this questions )。

此外,在 iOS6 中,Apple 添加了 2 个新方法来获取唯一标识符(作为 NSUUID 类的实例):

UIDevice -identifierForVendor:

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps onthe same device that come from different vendors, and for apps on different devices regardles of vendor.

ASIdentifierManager -advertisingIdentifier:

Unlike the identifierForVendor property of the UIDevice, the same value is returned to all vendors. This identifier may change—for example, if the user erases the device—so you should not cache it.

关于iphone - 每部 iPhone/iPod Touch 是否都有唯一的 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1476118/

相关文章:

iphone - 从 wifi h.264 摄像机直接直播到 iPhone

iPhone CoreData 应用程序首次启动时崩溃

javascript - 检测 ios11 设备是否处于低功耗模式,以防止在正常正确自动播放视频时出现不良用户体验

iphone - 在另一个应用程序中模拟 iPhone 应用程序?

ios - 如何让我的框架代码在应用程序启动时自动运行?

objective-c - UITextView beginningOfDocument 返回 nil

Git:如何从推送中排除一个分支?

google-chrome - 谷歌浏览器下无法删除IndexedDB

ios - tableviewcell 中的图像不会立即出现

email - 电子邮件分析如何工作?