Alternative to iPhone device ID (UDID)

Martin picture Martin · Mar 9, 2012 · Viewed 17.6k times · Source

Possible Duplicate:
UIDevice uniqueIdentifier Deprecated - What To Do Now?

Even if Apple was not at Barcelone's MWC (mobile world congress), there was the certitude that getting the deviceID will be deprecated in further iOS SDK.

I do not understand why Apple want to restrict this, but that's not the topic.

I must prepare my application to an alternative because my users are identified and known for a better use of my app (don't need to log, or create an account, for example). And I'm sure I'm not alone in that case.

So anybody know an alternative from getting the deviceID ? Is there other unique identifier, like MAC address, for example ? How do you prepare your app ?

Answer

Ankit Srivastava picture Ankit Srivastava · Mar 9, 2012

UPDATE

What about using CFUUID to generate a UUID. You can than store it in KEYCHAIN on the very first launch.. you can get it like this...

NSString *uuid = nil;
CFUUIDRef theUUID = CFUUIDCreate(kCFAllocatorDefault);
if (theUUID) {
  uuid = NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID));
  [uuid autorelease];
  CFRelease(theUUID);
}

and also by deprecating the uniqueIdentifier method, Apple is suggesting that you don't identify per device but instead per app install. may be tomorrow they might decide to reject your app for doing this .. :/ hoping this helps.