How to Get the Udid in iOS 6 and iOS 7

How to get the UDID in iOS 6 and iOS 7

UDID is no longer available in iOS 6+ due to security / privacy reasons. Instead, use identifierForVendor or advertisingIdentifier.

identifierForVendor:

An alphanumeric string that uniquely identifies a device to the app’s
vendor. (read-only)

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.

advertisingIdentifier:

An alphanumeric string unique to each device, used only for serving
advertisements. (read-only)

Unlike the identifierForVendor property of UIDevice, the same value is
returned to all vendors. This identifier may change—for example, if
the user erases the device—so you should not cache it.

This post explains it well.

Also, see Apple's documentation for the identifierForVendor and advertisingIdentifier.

Creating UUID and UDID in iOS 7

I have created a vendor ID and then saved it with keychain, which I am retaining for next time using KeychainWrapper keychainStringFromMatchingIdentifier:...

How to get Device UDID in programmatically in iOS7?

It's work 100% to all the version

other best option recommend by apple use ASIdentifierManager Class Reference

ios7-app-backward-compatible-with-ios5-regarding-unique-identifier

this link tell you how to handle and use custom framework

uidevice-uniqueidentifier-property-is-deprecated-what-now

iOS 9

NSUUID *uuid = [[NSUUID alloc]initWithUUIDString:@"20B0DDE7-6087-4607-842A-E97C72E4D522"];
NSLog(@"%@",uuid);
NSLog(@"%@",[uuid UUIDString]);

or

it support only ios 6.0 and above

code to use [[[UIDevice currentDevice] identifierForVendor] UUIDString];

NSUUID *deviceId;
#if TARGET_IPHONE_SIMULATOR
deviceId = [NSUUID initWithUUIDString:@"UUID-STRING-VALUE"];
#else
deviceId = [UIDevice currentDevice].identifierForVendor;
#endif

ios 5 to use like

 if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) {
// This is will run if it is iOS6
return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} else {
// This is will run before iOS6 and you can use openUDID or other
// method to generate an identifier
}

UDID Replacement in IOS7

After trying all possible replacements. Advertising identifier is the best way to go. It remains same even after phone reset when i tested. If the user turn it off in the settings then we get a null value. Except for this hitch, this is the best replacement so far. Will update if i find any other better replacements.

iOS 7 showing different UDIDs in different applications

You can't.

identifierForVendor will only give you the same identifier for apps from the same developer on that device. And it's not guaranteed to be permanent; if you delete all the apps from the vendor, and then reinstall them, it's likely you'll get a different identifier.

As for your iOS6 implementation, that's not going to give you anything permanent, as the point of a UUID is to give you a unique string every time.

Is there a way since (iOS 7's release) to get the UDID without using iTunes on a PC/Mac?

Here's my research results:

Apple has hidden the UDID from all public APIs, starting with iOS 7. Any UDID that begins with FFFF is a fake ID. The "Send UDID" apps that previously worked can no longer be used to gather UDID for test devices. (sigh!)

The UDID is shown when a device is connected to XCode (in the organizer), and when the device is connected to iTunes (although you have to click on 'Serial Number' to get the Identifier to display.

If you need to get the UDID for a device to add to a provisioning profile, and can't do it yourself in XCode, you will have to walk them through the steps to copy/paste it from iTunes.

UPDATE -- see okiharaherbst's answer below for a script based approach to allow test users to provide you with their device UDIDs by hosting a mobileconfig file on a server

Get UDID from beta testers iOS 7

Getting UDID programmatically will not work from iOS7.0 and upwards, since Apple apparently has moved it to "Private API" space for security reasons. However, you can still see the UDID of a device when it is connected to XCode (Xcode-> Organizer-> {Your Device Name}-> Identifier). You can also see it when the device is connected to iTunes, by clicking on the "Serial Number" once (it toggles between Serial No. and the UDID). You will have to ask your beta testers to find the device UDIDs this way and send you across, I suppose.



Related Topics



Leave a reply



Submit