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的数据格式.长度及一些基本知识. 一 ...
 
随机推荐
- 【JUnit   报错】java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message
			
使用JUnit的时候,报错:java.lang.NoClassDefFoundError: org/apache/logging/log4j/message/Message 原因是因为项目中导入的架包 ...
 - android 项目中规范使用SharedPreferences
			
一.SharedPreferences是什么来的? SharedPreferences是Android四种数据存储技术中的一种(SharedPreferences.SQLite.Content Pro ...
 - java中异步多线程超时导致的服务异常
			
在项目中为了提高大并发量时的性能稳定性,经常会使用到线程池来做多线程异步操作,多线程有2种,一种是实现runnable接口,这种没有返回值,一种是实现Callable接口,这种有返回值. 当其中一个线 ...
 - 2016.6.20   计算机网络复习要点第三章之CSMA/CD协议
			
1.最早的以太网是将许多计算机都连接到一根总线上: (1)总线的特点是:当一台计算机发送数据时,总线上的所有计算机都检测到这个数据,这种就是广播通信方式: (2)为了实现在总线上的一对一通信,可以使每 ...
 - SCU3185 Black and white(二分图最大点权独立集)
			
题目大概说有几个黑色.白色矩阵,问能选出黑白不相交的矩形面积和的最大值. 建二分图,黑色矩阵为X部的点,白色为Y部,XY的点权都为其矩阵面积,如果有个黑白矩阵相交则它们之间有一条边,那样问题就是要从这 ...
 - android studio ndk 调试
			
一: 先看看用 ndk-gdb 手动调试 这种方法只适用于手动编写 Android.mk 的情况,因为我们要手动 build debug 版本的 .so 文件.具体可以参考我的前一篇文章. 1 And ...
 - HDU 4511 (AC自动机+状态压缩DP)
			
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4511 题目大意:从1走到N,中间可以选择性经过某些点,比如1->N,或1->2-> ...
 - 怎么通过URL访问到服务器上的物理文件
			
目的 :搞清楚在jsp页面中如何引用static目录结构中的静态资源 一.URL URL的全称是统一资源定位符,俗称网页地址(网址),如同在网络上的门牌,是因特网上标准的资源的地址(Address). ...
 - Marching Cube
			
GPU-Marching-Cubes An Implementation of the Marching Cubes[1] Algorithm Marching Cubes Matlab The St ...
 - grep 命令搜索 带空格的字符
			
grep - n ' a[[:space:]]b' 就能搜索到 'a b'类似的字符了 如果要搜索带单引号的 用双引号括起来 如果要搜索带双引号的 用单引号括起来