Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacment UDID with OpenUDID is this good way?

So apple is rejecting apps which uses UDID. There are lots of posts on this, but i can't find where is written is it's good to use OpenUDID.

So maybe someone know if apple will approve this ? If OpenUDID has all features as UDID ?

Maybe someone is using this approach and could explain more ?

like image 331
Streetboy Avatar asked May 04 '12 11:05

Streetboy


2 Answers

Seems like the easiest solution is to just generate your own UUID:

NSString *UUID() {
    CFUUIDRef cfuuid = CFUUIDCreate(NULL); 
    NSString *uuid =  (__bridge_transfer NSString *)CFUUIDCreateString(NULL, cfuuid); 
    CFRelease(cfuuid);
    return uuid;
}

If you need to keep this across uninstall/install cycles, put it in the keychain as described here: https://stackoverflow.com/a/11597291/382374

Best thing, this is how Apple suggests you do it.

Good luck!

like image 93
Erik Avatar answered Oct 05 '22 08:10

Erik


We create our own UDIDs based on a hash of the device MAC address and the bundle identifier. This ensures that we can uniquely identify our app on a specific device.

You could also create a hash based only on the MAC address if you need a unique ID across multiple apps.

I've actually written a blog post about how to do this and provided some sample code here:

https://radeeccles.com/blog/create-your-own-unique-device-identifier-udid

like image 42
radesix Avatar answered Oct 05 '22 06:10

radesix