Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

get a unique identifier for each iPhone and iPad

Hi,


I'm new to MAC and iOS.

In my applications I need to get a unique id for the device(both iphone and ipad). This should be unique and should not change overtime.

I think UDID serves my purpose. But I read that using the UDID is deprecated in iOS 5. Please let me know how I can get a unique id for each device. It shouldn't change with time or network or anyother factor.


Thanks 🙂

Posted on Sep 22, 2012 11:57 PM

Reply
4 replies

Sep 23, 2012 8:11 PM in response to madhuatlink

See whether UIDevice identifierForVendor introduced in iOS 6 would work for your purposes.

identifierForVendor

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

@property(nonatomic, readonly, retain) NSUUID *identifierForVendor

Discussion

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 onthe same device that come from different vendors, and for apps on different devices regardles of vendor.

Availability

Available in iOS 6.0 and later.

Declared In

UIDevice.h

Sep 24, 2012 7:57 AM in response to madhuatlink

There are several open source libraries floating around to provide similar (not exactly the same) functionality as uniqueIdentifer in iOS 5+. Some are UIDevice categories so would be very easy to drop into an existing project that formerly used UIDevice uniqueIdentifier. Some derive the identifier from MAC address and app bundle identifier, some don't. Read carefully how each works, including the license terms. Two examples, I am sure there are more:


https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5


https://github.com/ylechelle/OpenUDID

get a unique identifier for each iPhone and iPad

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.