微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在iOS 6和iOS 7中获得UDID

参见英文答案 > UIDevice uniqueIdentifier Deprecated – What To Do Now?31
我想获取设备ID并将其发送到Web服务.如何在iOS 6中获得UDID?

谢谢

解决方法

由于安全/隐私的原因,UDID在iOS 6中不再可用.而应使用identifierForvendor或advertisingIdentifier.

identifierForvendor:

An alphanumeric string that uniquely identifies a device to the app’s
vendor. (read-only)

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 on the same device that come from different vendors,and for
apps on different devices regardless of vendor.

advertisingIdentifier:

An alphanumeric string unique to each device,used only for serving
advertisements. (read-only)

Unlike the identifierForvendor property of 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.

This帖子解释得很好.

另请参阅Apple的identifierForVendoradvertisingIdentifier文档.

原文地址:https://www.jb51.cc/iOS/336789.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐