首页 > 其他 > 详细

Device ID

时间:2014-01-14 19:49:41      阅读:580      评论:0      收藏:0      [点我收藏+]

参考文章

 

一、CFUUID (Deprecated)

二、UDID (Deprecated)

三、NSUUID (ios6.0 and later)

NSString *uuid = [[NSUUID UUID] UUIDString];

  1) 每次调用都会返回不同的值。

 

四、Advertiser Identifier (ios6.0 and later)

NSString *adId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];

  1) 需要 AdSupport.framework

  2) 除了以下情况会重新产生新的 id外,一般情况下是固定不变的。

    a> reset the system (Settings.app -> General -> Reset -> Reset All Content and Settings)

    b> 如果用户在 settings 选择了 "Limit Ad Tracking" on,会限制程序访问 Advertiser Identifier。

 

五、Identifier for vendor (ios6.0 and later)

NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

  1) 在同一个设备上,同 vendor 的 app 的此 id 是一样的。

  2) vendor is defined by the first two parts of the reverse DNS formatted CFBundleIdentifier. 

    example 

      com.doubleencore.app1 and com.doubleencore.app2    same

      com.massivelyoverrated or even net.doubleencore   different

  3) 如果用户把设备上 同一个 vendor 的 apps 都删除掉,下一次安装后此 id 会重新产生。

 

六、第三方的 OpenUDID(ios5.0 and later,不建议使用)

NSString *openUDID = [OpenUDID value];

 

bubuko.com,布布扣

Device ID

原文:http://www.cnblogs.com/eileenleung/p/3512937.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!