Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UDID Replacement in IOS7

Tags:

ios

ios7

udid

Is there is a alternative for UDID. My app will not be going to App Store as i'm using enterprise distribution. So is there any replacement. I tied advertising identifier, open udid, UIID and secure UDID. But if the phone is reset then i will get a new UDID. Any help would be appreciated.

like image 749
Avinash Avatar asked Sep 18 '13 09:09

Avinash


People also ask

Does Apple still use UDID?

Apple Will No Longer Approve Apps Using Unique Device Identifier (UDID) Beginning May 1, Must Also Support iPhone 5 and Retina Display - MacRumors.

Why is UDID important?

Disability Certificate Issuing Authorities (CMO Office/Medical Authority) will use this application to record the details of Persons with Disabilities (PwDs) and issue Disability Certificate/UDID Card electronically. Application from the PwD will be received by the CMO Office/Medical Authority.

Can UDID be shared?

If you trust the developer, sure. The UDID is just a unique identifier for your physical iPhone, and the developer needs to register it with Apple so that they can build the app for you.


1 Answers

For above 6.0 iOS you can use identifierForVendor Or CFUUIDRef.

-(NSString*)uniqID
{
    NSString* uniqueIdentifier = nil;
    if( [UIDevice instancesRespondToSelector:@selector(identifierForVendor)] ) {
        // iOS 6+
        uniqueIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
    } else {
        // before iOS 6, so just generate an identifier and store it
        uniqueIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:@"identifierForVendor"];
        if( !uniqueIdentifier ) {
            CFUUIDRef uuid = CFUUIDCreate(NULL);
            uniqueIdentifier = ( NSString*)CFUUIDCreateString(NULL, uuid);
            CFRelease(uuid);
            [[NSUserDefaults standardUserDefaults] setObject:uniqueIdentifier forKey:@"identifierForVendor"];
        }
    }
return uniqueIdentifier;
}//

UPDATE

As Leon Lucardie comment he is right

identifierForVendor will change after app uninstall/reinstall. See here The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them.

like image 168
Nitin Gohel Avatar answered Oct 10 '22 02:10

Nitin Gohel