鑾峰彇UUID
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了鑾峰彇UUID相关的知识,希望对你有一定的参考价值。
鏍囩锛?/p>
UDID
璁惧鐨勫敮涓€鏍囪瘑绗︼紝涔熷氨鏄澶囩殑搴忓垪鍙凤紝鍦╥OS2.0鐗堟湰涓璘IDevice鎻愪緵浜嗕竴涓幏鍙栬澶囧敮涓€鏍囪瘑绗︾殑鏂规硶uniqueldentifier锛岃繖涓柟娉曚篃鏄负涓€涓彲浠ョ‘璁よ幏鍙栨鏍囪瘑绗︾殑鏂规硶銆備絾鏄紝杩欎釜鏂规硶宸茶搴熷純锛屽悓鏃讹紝鑻规灉涔熶笉鍏佽鑾峰彇UDID鐨凙PP涓婄嚎銆?/p>
UUID
UUID鑾峰彇鏂瑰紡濡備笅锛?/p>
+ (NSString *)getEquipmentOfUUID{ CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); CFStringRef strRef = CFUUIDCreateString(kCFAllocatorDefault, uuidRef); NSString *resultString = [(__bridge NSString *)strRef stringByReplacingOccurrencesOfString:@"-" withString:@""]; CFRelease(strRef); CFRelease(uuidRef); return resultString; }
IDFA
骞垮憡id锛屽悓涓€璁惧涓婃墍鏈夌殑APP鑾峰彇鍒扮殑鍊兼槸鐩稿悓鐨勶紝鐢ㄤ簬杩借釜鐢ㄦ埛鑰岃鐨勶紝鐢ㄤ簬鍙互閫氳繃璁剧疆->闅愮->骞垮憡->骞垮憡杩借釜杩涜璁剧疆锛屽彲鑳藉彇涓嶅埌锛岃嫻鏋滆澶囬粯璁ゆ槸寮€鐨勩€?nbsp;
PS锛氭鍊煎彲鑳藉彇涓嶅埌锛屼笉鑳戒綔涓轰富涓氬姟鐨刬d銆?nbsp;
IDFA鑾峰彇鏂瑰紡濡備笅锛?/p>
#import <AdSupport/AdSupport.h> // 瀵煎叆姝ゅご鏂囦欢
+ (NSString *)getEquipmentOfIDFA{ NSString *resultString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; if ([resultString containsString:@"-"]) { resultString = [resultString stringByReplacingOccurrencesOfString:@"-" withString:@""]; } return resultString; }
IDFV
鐢ㄤ簬Vender琛ㄧず鏍囪瘑鐢ㄦ埛鐢ㄧ殑锛孷ender鏄寚搴旂敤鎻愪緵鍟嗭紝姣忎釜璁惧鍦ㄦ墍灞炲悓涓€涓猇ender鐨勫簲鐢ㄩ噷锛岄兘鏈夌浉鍚岀殑鍊笺€傞€氳繃BundleID鐨勫弽杞殑鍓嶄袱閮ㄥ垎杩涜鍖归厤锛屽鏋滅浉鍚屽氨鏄悓涓€涓猇ender銆?渚嬪com.370969280.app1 鍜?com.370969280.app2 灏辨槸鍚屼竴涓猇ender,IDFV鍊煎氨鐩稿悓)銆?nbsp;
PS锛?銆佸彧瑕丄PP1涓嶢PP2涓嶅叏閮ㄥ垹闄わ紝姝ゅ€煎氨涓嶄細鍙戠敓鏀瑰彉锛涘叏閮ㄥ垹闄ゅ悗锛屽啀瀹夎APP锛屾鍊煎皢浼氬彂鐢熸敼鍙樸€?nbsp;
渚嬪锛氬厛瀹夎APP1锛屽啀瀹夎APP2锛屼袱涓狝PP鐨処DFV鍊肩浉鍚岋紱鍒犻櫎APP2淇濈暀APP1锛岀劧鍚庨噸瑁匒PP2锛屾鏃禔PP2鑾峰彇鐨処DFV鍊间緷鏃т笌APP1鐩稿悓銆?nbsp;
2銆佹鍊间竴瀹氬彲浠ヨ幏鍙栧埌銆?nbsp;
IDFV鑾峰彇鏂瑰紡濡備笅锛?/p>
#import <UIKit/UIKit.h> // 瀵煎叆姝ゅご鏂囦欢
+ (NSString *)getEquipmentOfIDFV{ NSString *resultString = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; if ([resultString containsString:@"-"]) { resultString = [resultString stringByReplacingOccurrencesOfString:@"-" withString:@""]; } return resultString; }
以上是关于鑾峰彇UUID的主要内容,如果未能解决你的问题,请参考以下文章