ylechelle/OpenUDID — Issue #3: OpenUDID persistence and Potential Crash
Author: vovagalchenko
Created: 2011-10-19 19:34:19+00:00
State: open

Hi,

I've looked through the code, as I'm interested in the idea and am considering using openUDID. I have some concerns about it, however, and was wondering if maybe I'm misunderstanding something.

1. Please correct me if I'm wrong, but as far as I understand, a UIPasteboard key-value pair created by an app vanishes when the app is deleted. As far as I understand, that's the purpose of the redundant 100 UIPasteboard slots you've employed. Nevertheless, am I correct in saying that if every OpenUDID-enabled app was removed from a device and then another OpenUDID-enabled app was installed on it, a new unique OpenUDID would be created for that device?

2. Here I'd like to refer to the following code from the + (NSString*) _getOpenUDID function:

// One day, this may no longer be allowed in iOS. When that is, just comment this line out.
//
#if TARGET_OS_IPHONE
_openUDID = [[UIDevice currentDevice] uniqueIdentifier];
#endif

If I (and others) were to build OpenUDID into their apps, when Apple discontinues uniqueIdentifier, this will result in a crash. I understand, we can then comment out this line and rebuild the apps and things will work again, but in the meantime, there would be an avalanche of crashes sweeping the OpenUDID-land. Would this not be a more bulletproof solution:

if([UIDevice instancesRespondToSelector:@selector(uniqueIdentifier)]){
_openUDID = [[UIDevice currentDevice] uniqueIdentifier];
}

I appreciate you working on this problem and let me know what you think if you have time.

vova