Question

First of all, I'd like to say that I'm fully aware that uniqueIdentifier has been deprecated and there are identifierForVendor & advertisingIdentifier.

My question is, if there is a way to have a fully persistent device identifier which lives through anything like reboots, app uninstalls, etc.

Currently we use identifierForVendor which is OK - but one of our product's main requirements is to allow quick login without any registration, and when people delete our app their save acts as a "local save" (even though it's hosted on our servers) - as their identifierForVendor changes.

Hope someone had better luck than me in finding an answer (or if there even is an answer :P)

Thanks

Était-ce utile?

La solution

The best you can do is create a guid yourself and store it in the keychain for your app. That will survive uninstalls and reboots, but not system wipes. If the user logs in to some cloud service that you can create an association with on your server, e.g. Game Center or Facebook, then that id is generally stable across system wipes and you could do a lookup there. Be careful not to violate those services TOS, however.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top