How to get Device UDID in programmatically in iOS7?

前端 未结 10 2221
梦谈多话
梦谈多话 2020-12-04 18:33

How to get device UDID in programatically in iOS7.[[UIDevice currentDevice] uniqueIdentifier] I was used this code This is deprecated iOS7. how to get the devic

10条回答
  •  粉色の甜心
    2020-12-04 19:04

    For getting UDID: (If you're using this Might be App store guys won't allow it --> As per my concern)

    - (NSString *)udid
    {
    void *gestalt = dlopen("/usr/lib/libMobileGestalt.dylib", RTLD_GLOBAL | RTLD_LAZY);
    CFStringRef (*MGCopyAnswer)(CFStringRef) = (CFStringRef (*)(CFStringRef))(dlsym(gestalt, "MGCopyAnswer"));
    return CFBridgingRelease(MGCopyAnswer(CFSTR("UniqueDeviceID")));
    }
    
     **Entitlements:**
     com.apple.private.MobileGestalt.AllowedProtectedKeys
       
    UniqueDeviceID
    
    

    For Getting UUID:

        self.uuidTxtFldRef.text = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
    

提交回复
热议问题