天天看點

iOS 唯一标示符 解除安裝後安裝值不變

Vindor标示符 (IDFV-identifierForVendor)

這種叫法也是在iOS 6中新增的,不過擷取這個IDFV的新方法被添加在已有的UIDevice類中。跟advertisingIdentifier一樣,該方法傳回的是一個NSUUID對象。

NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

蘋果官方的文檔中對identifierForVendor有如下這樣的一段描述 :

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.

如果滿足這樣的條件,那麼擷取到的這個屬性值就不會變:相同的一個程式裡面-相同的vindor-相同的裝置。如果是這樣的情況,那麼這個值是不會相同的:相同的程式-相同的裝置-不同的vindor,或者是相同的程式-不同的裝置-無論是否相同的vindor。

vendor非常簡單:一個Vendor是CFBundleIdentifier(反轉DNS格式)的前兩部分。例如,com.doubleencore.app1 和 com.doubleencore.app2 得到的identifierForVendor是相同的,因為它們的CFBundleIdentifier 前兩部分是相同的。不過這樣獲得的identifierForVendor則完全不同:com.massivelyoverrated 或 net.doubleencore。

PS:解除安裝後安裝值不變

示例: 599F9C00-92DC-4B5C-9464-7971F01F8370

轉載于:https://www.cnblogs.com/jgl-blog/p/5110789.html