You should be able to use [UIDevice identifierForVendor]
for your purpose. According to the documentation:
The value of this property is the same for apps that come from the same vendor running on the same device.
Based on that I don't think the value should change if you delete and reinstall the application. Some quick testing confirms that it is persistent through delete/install cycles.
EDIT:
It looks like identifierForVendor
is only persistent through remove/install on iOS 7, so use uniqueIdentifier on iOS 6 and identifierForVendor on iOS 7 as:
@implementation UIDevice (persistentDeviceIdentifier)
-(NSString*)persistentDeviceIdentifier
{
if([self respondsToSelector:@selector(uniqueIdentifier)])
return [self performSelector:@selector(uniqueIdentifier)];
else
return [[self identifierForVendor] UUIDString];
}
@end