uuid - How to preserve identifierForVendor in ios after uninstalling ios app on device? -


"postprint" itemprop = "text">

I call the web service for which login and at that time I send login credentials to the web server with an iOS application developed To be the vendor identifier (identifierForVendor), it can be only a tool and a credential to identify specific devices for those credentials. So user.

I found identifierForVendor with NSString * UUID = [[UIDevice currentDevice] identifierForVendor] .UUIDString

This identifier can then use the web server The database will store in the database and the database. Next time also when the user opens the application and will try to download the data from the web server will first compare them with identifier stored on the local identifierForVendor web server on those devices.

The problem occurs when the user uninstall the application and reinstall it, I found that the identifierForVendor changes. So the user can not move forward

I read the apple document

As mentioned there, if all the applications from the same vendor will be uninstalled from the device then the new installation of any application will be uninstalled from the device. Take the identifier

So how to deal with it in my case?

You can keep it in the keychain

  - (NSString * ) GetUniqueDeviceIdentifierAsString {NSString * appName = [[NSBundle mainBundle] infoDictionary] objectForKey: (NSString *) kCFBundleNameKey]; NSString * strApplicationUUID = [SSKeychain passwordForService: appName account: @ "encoding"]; If (strApplicationUUID == zero) {strApplicationUUID = [[[UIDEVIS current device] identifier frontender] UUIDString]; [SSKeychain setPassword: service for strApplicationUUID: appName account: @ "encoding"]; } Return strApplicationUUID; }  

Comments