As posted yesterday, the UDID is being deprecated from from iOS 5 and will possibly be phased out in iOS 6.
This is mostly a good thing. Since the UDID does not change between the apps we use nor the sites we visit a very specific bread-crumb trail of our movements can be determined. It’s akin to leaving your business card at every restaurant and shop you patron. If all those cards were entered into a shared database the type of person you are and what your likely interests are can easily be guessed.
However, some of us developers simply want a means to distinguish the users who use our apps. The UDID was the silver bullet and its deprecation presents challenges for us.
A GUID is one partial solution to this. GUID stands for Globally Unique IDentifier.
The properties of a GUID
- Each is only issued once
- Not linked to the device generating it
- Does not have 1:1 relationship to a user
Unlike a UDID which is tied to the device, a GUID is not necessarily tied to anything. It’s just a unique ID.
A user could have many GUIDs so it’s impossible to say that GUID A and GUID B are 2 distinct people as the same person could own both. However for most purposes a system which separates content by GUID can reliably keep my documents separate from yours on the cloud.
GUID Generation In Objective C
Generating GUIDs is trivial. KEYBOX generates GUIDs to uniquely identify each secret across exports and imports. Here is the relevant snippet of the GUID generation implementation used by KEYBOX.
+ (NSString *) generateGuid {
CFUUIDRef uuid = CFUUIDCreate(NULL);
CFStringRef uuidStr = CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
[(NSString *) uuidStr autorelease];
return (NSString *) uuidStr;
}
It won’t help determine the exact device or its user nor will it help track users across sites or apps but it will help to assign identifiers like Twitter User Numbers to users who want to sign up to a cloud-based service.
In the end it may prove the most balanced ID system for users and developers.