更新时间:2023-01-14 10:31:00
注意:从2013年5月1日起,苹果将不再接受访问设备UDID的应用。
而是必须使用新方法 identifierForVendor
和 advertisingIdentifier
在iOS 6+中访问此。有关详情,请参阅相关博文。
Instead, you must use the new methods identifierForVendor
and advertisingIdentifier
in iOS 6+ for accessing this. See related post here for more detail.
旧方式(已弃用,将导致App Store拒绝)
Old way (deprecated and will result in App Store rejection)
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
从iOS7开始, uniqueIdentifier
不再可用。
As of iOS7, the uniqueIdentifier
property is no longer available.
请参阅 UIDevice
参考。
See the UIDevice
reference.