Search code examples
iosidentifierudid

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


I know that a UDID is 40 characters long. Now, Apple forbids their usage and has replaced them with vendor and advertising identifiers for iPhones.

I need to replace them in DB, but I cannot find their length. What is the length of these new identifiers?


Solution

  • 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.