How to get the UDID in iOS 6 and iOS 7
我想获取设备ID并将其发送到Web服务。我怎样才能在iOS 6中获得
谢谢
由于安全/隐私原因,iOS 6+不再提供UDID。相反,使用
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.
广告识别码:
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.
这篇文章解释得很好。
另外,请参见苹果公司有关
查看openudid:
OpenUDID is a drop-in replacement for the deprecated uniqueIdentifier property of the UIDevice class on iOS (a.k.a. UDID) and otherwise is an industry-friendly equivalent for iOS and Android, and most recently Windows C# and Silverlight (see links above).
编辑:请确保从2013年5月1日起,iOS 6将使用此分支,直到更新主目录: