[iOS]iOS8可用的识别用户方式(IDFA、UUID、IDFV)
来源:互联网 发布:网络上赌博的托 编辑:程序博客网 时间:2024/06/08 16:32
本文地址:http://blog.csdn.net/zhaoyabei/article/details/46682765 转载注明出处
想要追踪、统计用户,自然离不开用户唯一标识符,这是每个公司都面临的问题。在历史上唯一标识符很多,如UDID、MAC地址、OpenUDID等,不再一一介绍他们是怎么挂掉的,现在好用的只剩下了idfa、idfv、UUID+keyChain。
IDFA(Advertising Identifier)
可以理解为广告id,Apple公司提供的用于追踪用户的广告标识符。
- 缺点:用户可通过设置-隐私-广告-还原广告标识符 还原,之后会得新的到标识符;
- 要求iOS>=6.0。
- 使用:
- 1
- 2
IDFV (IdentifierForVendor)
Apple提供给Vendor的唯一标识符,Vendor代表了应用开发商.
实际使用时,一个Vendor具体定义如下:
iOS6:Bundle ID(CFBundleIdentifier)的前两位,如果Bundle ID 只有一位,那就使用全部Bundle ID。
iOS7: Bundle ID(CFBundleIdentifier)除去最后一部分的内容. 如果Bundle ID 只有一位,那就使用全部Bundle ID。
例如,com.baidu.tieba 和 com.baidu.image 所有情况下得到的idfv是相同的,因为它们的CFBundleIdentifier 前两部分是相同的。com.baidu.tieba.a 和 com.baidu.image.b在iOS6得到的idfv相同,在iOS7及以上得到的idfv就不同。
Apple官方文档上的说明:
The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.
Normally, the vendor is determined by data provided by the App Store. If the app was not installed from the app store (such as enterprise apps and apps still in development), then a vendor identifier is calculated based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format.
On iOS 6, the first two components of the bundle ID are used to generate the vendor ID. if the bundle ID only has a single component, then the entire bundle ID is used.
On IOS 7, all components of the bundle except for the last component are used to generate the vendor ID. If the bundle ID only has a single component, then the entire bundle ID is used.
- 缺点:把同一个开发商的所有应用卸载后,再次安装取到的idfv会不同。假设手机上装有公司的两款app:XX贴吧、XX微博,两个APP同时被卸载后,再次安装获得的IDFV就跟原来不同了。
- 要求:iOS>=6.0
- 使用:
- 1
- 2
UUID(Universally Unique Identifier)
通用唯一识别码,每次生成均不一样,所以第一次生成后需要保存到钥匙串,这样即使应用删除再重装仍然可以从钥匙串得到它。
- 使用:
UUID生成方法很多种,这里只写出一种。生成一个UUID:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
将UUID储存在钥匙串,这里用到了一个第三方的工具:SFHFKeychainUtils:GitHub地址
- 1
从钥匙串取出UUID:
- 1
注意,如果没有存储就直接取出会crash。
一般情况下使用第三种UUID就可满足,也有一些公司会将多种方式结合起来使用,具体看公司需求。
- [iOS]iOS8可用的识别用户方式(IDFA、UUID、IDFV)
- [iOS]iOS8可用的识别用户方式(idfa、UUID、idfv)
- iOS中的几个id(UDID、UUID、IDFA、IDFV)
- iOS获取设备唯一标识的各种方法?IDFA、IDFV、UDID,UUID分别是什么含义?
- iOS 常用常用的id IDFA IDFV MAC UDID openUDID
- iOS 常用常用的id IDFA IDFV MAC UDID openUDID
- ios常用的ID(IDFA IDFV MAC UDID openUDID )
- iOS 常用常用的id IDFA IDFV MAC UDID openUDID
- [转]iOS获取UDID问题 (代码获取不到) UDID/UUID/IDFA/IDFV详解
- iOS获取设备唯一标识的各种方法?IDFA、IDFV、UDID分别是什么含义?
- iOS获取设备唯一标识的各种方法?IDFA、IDFV、UDID分别是什么含义?
- iOS获取设备唯一标识的各种方法?IDFA、IDFV、UDID分别是什么含义?
- iOS获取设备唯一标识的各种方法?IDFA、IDFV、UDID分别是什么含义?
- iOS开发之获取设备唯一标识的各种方法?IDFA、IDFV、UDID分别是什么含义?
- idfa还是idfv,IOS唯一标示利弊分析
- idfa idfv mac地址
- ios开发——日常之 获取设备唯一标识的各种方法?IDFA、IDFV、UDID分别是什么含义?
- 常用的id IDFA IDFV MAC UDID openUDID
- 用一生回味的经典语录
- matlab常用命令
- hibernate里面的Restrictions用法
- 命令执行的判断依据: ; , &&, ||
- UIWindow & UIWindowLevel笔记
- [iOS]iOS8可用的识别用户方式(IDFA、UUID、IDFV)
- TLD特征点跟踪TLD(Tracking-Learning-Detection)
- Next Permutation
- Java中值与引用
- Spring的IOC容器—依赖注入
- OJ积累--对象转换
- IOS中UIDatePicker的setDate方法不好使(失效,无法设置date)
- 经典面试题
- Leetcode|Insert Interval