Since from iOS 5, Apple has deprecated the UIDevice uniqueIdentifier , that means traditional way of getting the unique id of each iOS device won't work now ie.
[[UIDevice currentDevice] uniqueIdentifier] fails from iOS 5 and more.
So for the alternative to the UUID , we can use the CFUUID class of Apple in order to create unique id for device. But, we really need to keep in mind that this inbuild class will create random numbers so they will return different ids on every call. Don't use NSUserDefaults for storing it, best way is to use Keychain.
So, here I am giving you the best way of using it in order to use it as a unique key for your device.
- (NSString *)createNewUUID {
CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFStringRef string = CFUUIDCreateString(NULL, theUUID);
CFRelease(theUUID);
return [(NSString *)string autorelease];
}
UDID:
http://whatsmyudid.com/
