5

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

Ron
  • 1,806
  • 3
  • 18
  • 31
  • 1
    Please search before asking. This question has been asked many times in the past. http://stackoverflow.com/search?q=iOS+UDID+replacement - The answer is almost always "use CFUUID to create your own UUID and persist it in the keychain". – Jasarien Jan 13 '14 at 16:03
  • Sorry I searched but didn't find the said solution – Ron Jan 13 '14 at 16:14
  • 1
    What happens when somebody upgrades their phone and sells their old one, and the new user of the phone suddenly finds that he has access to the data of the original phone's owner. There is a reason that Apple removed the ability to _easily_ have a persistent UDID. – Abizern Jan 13 '14 at 16:34
  • 1
    @Ron Before submitting a question, SO shows you a list of related questions. The 1st one listed would have answered your question. Always check the related questions before submitting your question. – rmaddy Jan 13 '14 at 16:44
  • Thanks for replying - I'll look better next time before posting a question – Ron Jan 13 '14 at 17:11
  • 1
    Have a look at http://stackoverflow.com/questions/7273014/ios-unique-user-identifier – Popeye Jan 13 '14 at 17:18

1 Answers1

5

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.

i_am_jorf
  • 53,608
  • 15
  • 131
  • 222
  • Thanks for the quick reply @jeffamaphone, a few questions: 1. Do you know of any apps that use this method so we can see the flow and see if it fits our needs? 2. From my experience with Keychain on Mac, it opens a nasty popup that asks for your password to store/read something to/from the keychain - does the same apply to the keychain on iOS? 3. Using the keychain on iOS requires an iCloud account as well? Thanks! – Ron Jan 13 '14 at 16:16
  • 1) The games my company makes, though I'd rather not mention them by name. 2) I haven't seen that happen on the iPhone. Access is controlled by your provisioning profile signature, so only your app can get at your keychain values. I suspect MacOS is not as locked down, since you can run unsigned apps. 3) Not to my knowledge. It's not a trivial concept, so you'll do best to read the documentation I linked to. – i_am_jorf Jan 13 '14 at 16:23
  • Thanks for the reply @jeffamaphone - if you happen to stumble across any games/apps that use this feature and aren't made by your company please share if you can :) Thanks, I'll look into it! – Ron Jan 13 '14 at 17:10