UDID (Unique Device Identifier)
iOS設(shè)備的唯一識(shí)別碼,它由40位16進(jìn)制數(shù)的字母和數(shù)字組成,除了越獄,沒(méi)什么辦法可以改變它
-
獲取方式
[[UIDevice currentDevice] uniqueIdentifier];iOS 5.0 開(kāi)始廢棄,采用改方法獲取,審核會(huì)被拒.之所以廢棄是因?yàn)橥ㄟ^(guò)UDID可以鎖定一臺(tái)設(shè)備,存在一定的風(fēng)險(xiǎn)
IDFV (IdentifierForVendor)
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.
線上: IDFV 會(huì)根據(jù)App Store給的數(shù)據(jù)決定,卸載重裝后也一致 (不同設(shè)備是不一樣的)
開(kāi)發(fā): 如果不是從App Store安裝的,那么會(huì)根據(jù)bundle ID的前兩個(gè)字端進(jìn)行計(jì)算,所以 com.example.a 和 com.example.b 在開(kāi)發(fā)階段計(jì)算出來(lái)的IDFV 會(huì)是一樣的.
-
獲取方式
#import <AdSupport/ASIdentifierManager.h> [[UIDevice currentDevice].identifierForVendor UUIDString]; -
重置方式
- (未從App Store 下載時(shí))當(dāng) bundle ID為 com.example.? 所有的app卸載之后會(huì)重置IDFV
IDFA (IdentifierForIdentifier)
廣告標(biāo)示符,在同一個(gè)設(shè)備上的所有App都會(huì)取到相同的值,是蘋果專門給各廣告提供商用來(lái)追蹤用戶而設(shè)的
-
獲取方式
#import <AdSupport/AdSupport.h> [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; -
重置方式
- 重置系統(tǒng)
- 設(shè)置程序 -> 通用 -> 還原 -> 還原位置與隱私
- 設(shè)置程序-> 通用 -> 關(guān)于本機(jī) -> 廣告 -> 還原廣告標(biāo)示符 -> 重啟
UUID (Universally Unique Identifier)
通用唯一識(shí)別碼(偽唯一),但是因?yàn)閁UID隨機(jī)數(shù)算法得到的數(shù)重復(fù)概率為170億分之一,幾乎可以保證每次隨機(jī)出來(lái)的值都是唯一的
-
獲取方式
[NSUUID UUID].UUIDString -
重置方式
- 每次運(yùn)行都會(huì)改變
唯一ID
可以通過(guò)UUID + Keychain的方式來(lái)得到唯一值