Friday 13 June 2014

How to find iPhone UDID in iphone 5, 5C & 5S iOS7 : 

What is the UDID?

Each iPhone or iPod Touch has a Unique Device Identifier (UDID), which is a sequence of 40 letters and numbers that is specific to your device. It’s like a serial number but much harder to guess. 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.

How do I get my UDID?

Easy Way .. Copy/Paste from iTunes
  1. Launch iTunes and connect your iPhone.
  2. In the right pane, locate the information about your iPhone, including its name, capacity, software version, serial number, and phone number.
  3. Reveal the Identifier by clicking on Serial Number:. Copy the Identifier to your clipboard by choosing Edit → Copy.

More Easy ? UDID app !!

There are a number of free apps that will tell you the UDID for your iOS device.
  1. http://whatsmyudid.com
  2. http://get.udid.io Wait..

Are you an iOS developer ? Well try this..

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.

You can use identifierForVendor after that store them to keychain and use later. Because value of keychain will not changed when re-install app.


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.

Check out OpenUDID: Open source initiative for a universal and persistent UDID solution for iOS http://OpenUDID.org

OpenUDID is a drop-in replacement for the deprecated uniqueIdentifier property of the UIDevice class on iOS (a.k.a. UDID) and otherwise is an industry-friendly equivalent for iOS and Android, and most recently Windows C# and Silverlight (see links above).
Also We can use identifierForVendor for ios7,

-(NSString*)uniqueIDForDevice
{
    NSString* uniqueIdentifier = nil;
// >=iOS 7 
if( [UIDevice instancesRespondToSelector:@selector(identifierForVendor)] ){
        uniqueIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
    } else { //<=iOS6, Use UDID of Device       
            CFUUIDRef uuid = CFUUIDCreate(NULL);
            //- for non- ARC
            //uniqueIdentifier = ( NSString*)CFUUIDCreateString(NULL, uuid);
            // for ARC
            uniqueIdentifier = ( NSString*)CFBridgingRelease(CFUUIDCreateString(NULL, 
                                uuid));
            CFRelease(uuid);
         }
    }
return uniqueIdentifier;
}

 

No comments:

Post a Comment