Alternative For IdentifierForVendor in ios7 Above

578 Views Asked by At

I noticed that whenever I reinstall my app, the IdentifierForVendor keeps on changing. Is there a way for me to have the same identifier for my device? The thing is, I need to make sure that the identifier is the same because I have a backup system that allows user to re-download their progress even after deleting and reinstalling the app. The identifierForVendor isn't a reliable value. I also looked at advertisingIdentifier but it's also no good. By any chance, do you know of a string returned by Apple that I may use as an alternative? Or is there a way to generate the same string for a certain device?

1

There are 1 best solutions below

12
On BEST ANSWER

The identifierForVendor is a reliable value, but only if the app has been downloaded from the app store, it won't change even if the user uninstalls and reinstall.

EDIT: This is no longer true, now when the app is downloaded from the apple store the identifierForVendor will be different if you remove the app and install it again, it even changed on app update due to an apple bug that it's fixed by now, but who knows if it will happen again. The identifierForVendor is not reliable if you want to use it's recommended to store it's value on the keychain

When installing from xcode, ad-hoc distribution and even the new testflight betatesting it changes after uninstalls if you don't have another of your apps installed with the same bundle id base name (com.yourcompany.xxxxx, com.yourcompany.yyyyy,com.yourcompany.zzzzzz)