Stavo aggiornando la mia applicazione che funzionava basandosi solo su Identificatore univoco che supportava iOS 4.3 e versioni successive. Così,
1) non ho potuto usare [UIDevice currentDevice].uniqueIdentifier;
in quanto non era più disponibile
2) non ho potuto usare [UIDevice currentDevice].identifierForVendor.UUIDString
perché era disponibile in iOS 6.0 e versioni successive ed è stato in grado di utilizzare per iOS più bassi versioni.
3) l'indirizzo MAC non era un'opzione in quanto non era permesso in iOS-7
4) OpenUDID era deprecated qualche tempo fa e ha avuto anche problemi con iOS-6.
identificatori 5) Pubblicità erano inoltre non è disponibile per iOS 5 e sotto
Infine questo era quello che ho fatto
a) Aggiunto SFHFKeychainUtils al progetto
b) Generato chiave CFUUID Stringa
CFUUIDRef cfuuid = CFUUIDCreate(kCFAllocatorDefault);
udidString = (NSString*)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, cfuuid));
c) Salvato in chiave catena Utils altrimenti verrà generato un nuovo univoco ogni volta
codice finale
+ (NSString *)GetDeviceID {
NSString *udidString;
udidString = [self objectForKey:@"deviceID"];
if(!udidString)
{
CFUUIDRef cfuuid = CFUUIDCreate(kCFAllocatorDefault);
udidString = (NSString*)CFBridgingRelease(CFUUIDCreateString(kCFAllocatorDefault, cfuuid));
CFRelease(cfuuid);
[self setObject:udidString forKey:@"deviceID"];
}
return udidString;
}
+(void) setObject:(NSString*) object forKey:(NSString*) key
{
NSString *objectString = object;
NSError *error = nil;
[SFHFKeychainUtils storeUsername:key
andPassword:objectString
forServiceName:@"LIB"
updateExisting:YES
error:&error];
if(error)
NSLog(@"%@", [error localizedDescription]);
}
+(NSString*) objectForKey:(NSString*) key
{
NSError *error = nil;
NSString *object = [SFHFKeychainUtils getPasswordForUsername:key
andServiceName:@"LIB"
error:&error];
if(error)
NSLog(@"%@", [error localizedDescription]);
return object;
}

For further Details
fonte
2013-10-08 10:37:07
C'è una ragione per cui sono deprecando questi tipi di ID univoci. Crea e archivia il tuo UUID ('CFUUIDCreate') o usa l'identificatore del venditore –