I am working on an app in which I need a device specific globally unique identifier (i.e imei etc). I have tried the following code, but it always generates a new uuid .
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
NSString *uuidStr = ( NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid);
CFRelease(uuid);
is there any way I can get a unique identifier that will last forever.
P.S:- I am using iOS 5 and iOS 6.
Apple does not allow you to track unique device since the device can change hands and you really want to track the user not the device. Apple is also of the opinion that is this a breach of privacy.
A goto solution is using OpenUDID they will generate a unique key per application which is stored in keychain. This means that if the user removes the app, the data in the keychain will persist.