I need the unique id of the device for login and I am using the following code.
NSString *str_udid=[[[UIDevice currentDevice] identifierForVendor] UUIDString];
But after uninstall the application new id is coming from old one.
I need the unique id of the device for login and I am using the following code.
NSString *str_udid=[[[UIDevice currentDevice] identifierForVendor] UUIDString];
But after uninstall the application new id is coming from old one.
Get a unique device ID and store that on the server. Since UDIDs are no longer allowed, that’s out.
[[UIDevice currentDevice] uniqueIdentifier]
Use something like the advertising ID. Trouble is, user can reset that and get a new one. Used only for serving advertisement.
Use something like vendor identifier. Uniquely identifies the device to the app’s vendor. The value changes when user deletes all the vendor’s apps from the device and reinstalls one or more of them.
Write a unique ID into the keychain or user preferences. User can delete app, reinstall, and redeem item again.
NSUUID *UUID = [NSUUID UUID];
NSString* stringUUID = [UUID UUIDString];
To get more information you can check
http://nshipster.com/uuid-udid-unique-identifier/
You can save str_udid
object into the Keychain. Here is the link about how to do that: https://github.com/kishikawakatsumi/KeychainAccess
It will not remove even if you have deleted your application from the device.