Device ID
一、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];

七、把 device id 存放到 system keychain,只有当设备 system restore 才会重置,而且keychain里保存的信息不会因App被删除而丢失。
(apple demo “GenericKeychain”)
1) 下载 apple 提供的 KeychainItemWrapper (如果使用的是 arc ,则需要标示 -fno-objc-arc)
2)需要的框架:Security.framework
3)使用
KeychainItemWrapper* keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:bundleID
accessGroup:nil];
// 读取
NSString* uuidStr = [keychainItem objectForKey: (id)kSecValueData]; // 写入
[keychainItem setObject:uuidStr forKey:(__bridge id)kSecAttrService];
[keychainItem setObject:uuidStr forKey:(id)kSecValueData];
Device ID的更多相关文章
- otg device id pin 探討
Platform : Qualcomm MSM8937 PMIC : Qualcomm PMI8940 OTG base on USB2.0,增加 device 可當 host 也可當 periphe ...
- Android Unique Device ID
There are several occasions when the unique identifier of a device is required. For instance you nee ...
- Alternative to iPhone device ID (UDID)
Alternative to iPhone device ID (UDID) [duplicate] up vote10down votefavorite 3 Possible Duplicate:U ...
- android device ID获取
Android Device ID是Android用户在Google认证过手机的设备唯一标识,当然国内很多Android手机没有经过Google认证,所以一般没有Google官方Android de ...
- STM32唯一ID(Unique Device ID)的读取方法
每一个STM32微控制器都自带一个96位的唯一ID,也就是Unique Device ID或称为UID,这个唯一ID在任何情况下都是唯一的且不允许修改. 在开发过程中,可能需要用到这个UID,比 ...
- 什么是Device ID?
Android ID用于唯一识别一部设备的一次刷机行为,虽然不能完全确定该设备的唯一性(真的唯一性是用IMEI号的),但是可以很大程度上过滤重复设备.这是移动互联网广告行业的基础,尤其是CPI广告,设 ...
- UNIX文件的权限之“设置用户ID位”
用stat函数可以获取一个文件的状态信息,原型是这样的: int stat(const char *path, struct stat *buf); 其中结构体stat的结构: struct stat ...
- [转]com.devicepush.cordova-phonegap Device Push Notification Plugin
本文转自:https://www.npmjs.com/package/com.devicepush.cordova-phonegap Device Push Notification Plugin D ...
- Android 系统ID介绍
Android上系统ID有很多,本文只介绍常用的ANDROID ID.DEVICE ID.IMEI/MEID.WIFI/BT ADDRESS等几个,本文介绍这些ID的数据格式.长度及一些基本知识. 一 ...
随机推荐
- filter()函数 条件筛选
filter()函数 filter()函数是 Python 内置的另一个有用的高阶函数,filter()函数接收一个函数 f 和一个list,这个函数 f 的作用是对每个元素进行判断,返回 True或 ...
- POJ1797 Heavy Transportation(SPFA)
题目要求1到n点的最大容量的增广路. 听说是最短路求的,然后乱搞就A了.. 大概能从Bellman-Ford的思想,dk[u]表示从源点出发经过最多k条边到达u点的最短路,上理解正确性. #inclu ...
- POJ1659 Frogs' Neighborhood(Havel定理)
给一个无向图的度序列判定是否可图化,并求方案: 可图化的判定:d1+d2+……dn=0(mod 2).关于具体图的构造,我们可以简单地把奇数度的点配对,剩下的全部搞成自环. 可简单图化的判定(Have ...
- 初识view
屏幕左上角为原点,向右为 x 轴, 向下为 y 轴. getLeft getTop getRight getBottom 分别返回 view 的左上右下的坐标,这里的坐标都是相对于view的父view ...
- BZOJ3498 : PA2009 Cakes
令三元环(i,j,k)中i>j>k,则每条边只需要从大点连向小点 设d[x]表示从x连出的边的条数 从1到n枚举点i,然后枚举所有与i相连的边(i,x)(x<i) 如果$d[x]\l ...
- ios 适应屏幕
标准做法:auto layout 其中:也可以用代码判断 1.如果不是hardcode的话,又怎么会不兼容呢.. 2.如果你全写320*480也是兼容吗 3.写320嘛的就是hardcode啊. ...
- [Unity2D]脚本基类MonoBehaviour介绍
Unity中的脚本都是继承自MonoBehaviour. MonoBehaviour 表示一个单一的行为.Unity中用户对游戏对象的操作被分割成若干个单一行为.每个单一行为都作为一个MonoBeha ...
- (转)js:字符串(string)转json
第一种方式: 使用js函数eval(); testJson=eval(testJson);是错误的转换方式. 正确的转换方式需要加(): testJson = eval("(" + ...
- js的url中传递中文参数乱码,如何获取url中参数问题
一:Js的Url中传递中文参数乱码问题,重点:encodeURI编码,decodeURI解码: 1.传参页面Javascript代码: <script type=”text/javascript ...
- [转帖] CvMat,Mat和IplImage之间的转化和拷贝
原文地址: http://blog.csdn.net/holybin/article/details/17711013 在OpenCV中Mat.CvMat和IplImage类型都可以代表和显示图像. ...