I was wondering if it was possible to find out the UDID of the user\'s iPhone. Can someone shed some light?
Like some said, in iOS5 this has been deprecated:
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
Apple now has 3 APIs to get a UUID(Universally Unique Identifier) of the device:
Alternative 1 (NSUUID class):
NSString *udid = [[NSUUID UUID] UUIDString];
Alternative 2 (UIDevice class):
NSString *udid = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
Alternative 3 (ASIdentifierManager class, requieres AdSupport framework):
NSUUID *UUID = [[ASIdentifierManager sharedManager] advertisingIdentifier];
NSString *udid = [UUID UUIDString];
But they are all alphanumeric, and a tipical device unique identifier is only digits. So thos 3 APIs are useless, and the old [[UIDevice currentDevice] uniqueIdentifier] still works in iOS6, but for how long?
If the "deprecated" warning bugs you, just add:
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Hope it helps!