鑾峰彇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的主要内容,如果未能解决你的问题,请参考以下文章

PostgreSQL 鑾峰彇 SEQUENCE 鍒楄〃

鑾峰彇鍏冪礌鍐呭

19_鑾峰彇鍛戒护鍙傛暟

鑾峰彇json涓殑灞炴€у€硷紝鐢熸垚鏂癹son

shell 鑾峰彇瀛楃涓茬殑闀垮害

Go鑾峰彇鐢ㄦ埛缁堢杈撳叆