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
iOS Static VS Dynamic Frameworks Clarifications
Autolayout Is Ignored in Custom Uitableviewcell
Making a Button Persistent Across All View Controllers
Remove Empty Space Before Cells in Uitableview
Updating iOS Badge Without Push Notifications
Wkwebview Persistent Storage of Cookies
Defaultcalendarfornewevents Failed
Ios9 - This Application Is Modifying the Autolayout Engine from a Background Thread -- Where
Prevent Deploying (Disable) Watchkit App with iOS iPhone App in Xcode
Saving Image to Documents Directory and Retrieving for Email Attachment
Metal - Resize Video Buffer Before Passing to Custom Kernel Filter
How to Set an Nsdate Object to Midnight
Table View Images Never Being Released
Get Safe Area Inset Top and Bottom Heights