How can I retrieve the UDID on iOS?

Note: Apple will no longer accept apps that access the UDID of a device starting May 1, 2013.

Instead, you must use the new methods identifierForVendor and advertisingIdentifier in iOS 6+ for accessing this. See related post here for more detail.


Old way (deprecated and will result in App Store rejection)

NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];

As of iOS7, the uniqueIdentifier property is no longer available.

See the UIDevice reference.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)