Ios6 Udid - What Advantages Does Identifierforvendor Have Over Identifierforadvertising

iOS6 UDID - What advantages does identifierForVendor have over identifierForAdvertising?

Important Note:

Apple just released iOS 6.0 and the NDA has been lifted.

For developers who preemptively included code that referenced

[[UIDevice currentDevice] identifierForAdvertising]

this method has NOT been included on iOS 6. If you use the above method, your app will (most likely) crash and be rejected!

Instead, Apple has created a new class ASIdentifierManager , which includes the method advertisingIdentifier. Here's the apple docs on it:

iOS6 UDID - What advantages does identifierForVendor have over identifierForAdvertising?

Important Note:

Apple just released iOS 6.0 and the NDA has been lifted.

For developers who preemptively included code that referenced

[[UIDevice currentDevice] identifierForAdvertising]

this method has NOT been included on iOS 6. If you use the above method, your app will (most likely) crash and be rejected!

Instead, Apple has created a new class ASIdentifierManager , which includes the method advertisingIdentifier. Here's the apple docs on it:

How long are the vendor and advertising IDs that have replaced iPhone UDIDs?

The new identifiers (identifierForVendor and advertisingIdentifier) are 36 characters long.

The previous method, uniqueIdentifier, returns an NSString, while both of the new methods return type NSUUID. This class conforms the the standard definition of a UUID, and is 32 characters long with 4 dashes.

Universally Unique Identifier - Definition

A valid UUID could come with or without the dashes, but the documentation for the NSUUID class clearly states that it does include the dashes.

What to do with apps running on iOS 5 and below for identifierForVender

Your app will be rejected if you continue to use uniqueIdentifier independently of the iOS version. I recommend using OpenUDID instead, which is a drop-in replacement for the deprecated uniqueIdentifier.

You could check whether identifierForVendor is available, or you can use OpenUDID in all cases.

if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) {
// Use: [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} else {
// Use: [OpenUDID value];
}

UDID Replacement in IOS7

After trying all possible replacements. Advertising identifier is the best way to go. It remains same even after phone reset when i tested. If the user turn it off in the settings then we get a null value. Except for this hitch, this is the best replacement so far. Will update if i find any other better replacements.



Related Topics



Leave a reply



Submit