I need to get a unique device id to populate a unique user id in the database. For this, I used the following code.
NSString *strApplicationUUID= [[[UIDevice currentDevice] identifierForVendor] UUIDString];
But when I reinstall the application, the UUID changes all the time. But as far as I know, the device ID never changes. To do this, I used the third-party code below SSKeychainto save and retrieve the old UDID:
NSString *Appname = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
NSString *strApplicationUUID = [SSKeychain passwordForService:Appname account:@"manab"];
if (strApplicationUUID == nil)
{
strApplicationUUID = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
[SSKeychain setPassword:strApplicationUUID forService:Appname account:@"manab"];
}
Now the problem is when the version of this application is changed. Application v2.0 for application v1.0, and then the UDID has changed. So, the logic is clear to me that I do not get a unique UDID all the time, I just get a UDID as a provider or application database.
? , , .