How can I retrieve the UDID on iOS?

前端 未结 10 1317
礼貌的吻别
礼貌的吻别 2020-12-14 06:05

I was wondering if it was possible to find out the UDID of the user\'s iPhone. Can someone shed some light?

10条回答
  •  感动是毒
    2020-12-14 06:52

    In IOS5 and above, use this one to find UDID

    NSString *uuidString = nil;
    CFUUIDRef uuid = CFUUIDCreate(NULL);
    if (uuid) {
        uuidString = (__bridge NSString *)CFUUIDCreateString(NULL, uuid);
        CFRelease(uuid);
    }
    NSLog(@"UDID: [%@]", uuidString);
    

提交回复
热议问题