Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to iPhone device ID (UDID) [duplicate]

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 ?

like image 634
Martin Avatar asked Mar 09 '12 09:03

Martin


People also ask

Is UDID and device ID the same?

Apple device IDsEvery Apple iPhone, iPod touch and iPad has a unique device ID number associated with it, known as a Unique Device ID (UDID). Apple's device ID is a 40-digit sequence of letters and numbers. Customers can access their device ID numbers in iTunes or by downloading a free app from the Apple App Store.

How do you uniquely identify an iOS device?

Is there any way to identify iOS device uniquely. You can't. Apple doesn't allow it for the sake of confidentiality. But you could use Keychain access to store some useful data.

Can you change UUID on iPhone?

Your UDID is in the hardware, it's a hash composed of various serial numbers and other values. You can't physically change your UDID.

What is the UUID of my iPhone?

Select your iOS device by clicking the device's image located at the upper-left corner of iTunes's UI. On the next screen, a window should appear listing your phone's Capacity, Phone Number, and Serial Number. By clicking on Serial Number once, the prompt should change to display your UDID.


2 Answers

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.

like image 57
Ankit Srivastava Avatar answered Sep 28 '22 14:09

Ankit Srivastava


try this

- (NSString *)getDeviceID
{
    NSString *uuid = [self gettingString:@"uniqueAppId"];
    if(uuid==nil || [uuid isEqualToString:@""])
    {
        CFUUIDRef theUUID = CFUUIDCreate(kCFAllocatorDefault);
        if (theUUID)
        {
            uuid = NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID));
            [self savingString:@"uniqueAppId" data:uuid];
            [uuid autorelease];
            CFRelease(theUUID);
        }
    }
    return uuid;

// this is depreciated  
//  UIDevice *device = [UIDevice currentDevice];
//  return [device uniqueIdentifier];
}
like image 2
hchouhan02 Avatar answered Sep 28 '22 14:09

hchouhan02