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的数据格式.长度及一些基本知识. 一 ...
随机推荐
- MySQL命令行查询乱码解决方法:
MySQL会出现中文乱码的原因不外乎下列几点:1.server本身设定问题,例如还停留在latin1 2.table的语系设定问题(包含character与collation) 3.客户端程式(例如p ...
- Xamarin.iOS提供没有匹配的配置文件
Xamarin.iOS提供没有匹配的配置文件 错误信息:No installed provisioning profiles match the installed ios code signing ...
- 最短路(Floyd_Warshall) POJ 1125 Stockbroker Grapevine
题目传送门 /* 最短路:Floyd模板题 主要是两点最短的距离和起始位置 http://blog.csdn.net/y990041769/article/details/37955253 */ #i ...
- POJ3493 Largest Submatrix of All 1’s(单调栈)
题目给一个01矩阵,求最大的1子矩阵. 先用dp预处理出每一行的每一列的1能向上按连续的1延伸多少,然后枚举每一行作为子矩阵的底,那样对于每一行的答案就是POJ2559这个经典问题了. #includ ...
- BZOJ4310 : 跳蚤
首先求出后缀数组,得到本质不同的子串的个数. 然后二分答案,每次先通过后缀数组求出第$mid$小的子串,然后贪心进行检验. 检验的时候,从后往前贪心,每次加入一个后缀,如果不能加了,那就划为一段. 时 ...
- HDU 4507 (鬼畜级别的数位DP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4507 题目大意:求指定范围内与7不沾边的所有数的平方和.结果要mod 10^9+7(鬼畜の元凶) 解题 ...
- Origami
Origami 是一个来自 Facebook 设计团队的作品,是 Quartz Composer 的免费工具包,可在无需编程的情况下轻松实现与设计原型进行交互.
- objective-c "performSelector may cause a leak because its selector is unknown".
#define SuppressPerformSelectorLeakWarning(Stuff) \ do { \ _Pragma("clang diagnostic push" ...
- 洛谷 P1008 三连击 Label:水
题目描述 将1,2,…,9共9个数分成三组,分别组成三个三位数,且使这三个三位数构成1:2:3的比例,试求出所有满足条件的三个三位数. 输入输出格式 输入格式: 木有输入 输出格式: 若干行,每行3个 ...
- winform学习之----Directory
Directory 文件夹目录 几个方法: CreateDirectory,delete,move,getfiles,exists 操作文件:用File 操作路径:用path 操作文件夹:Direct ...