2

If you don't know, your app will not be able to get a UUID anymore in iOS 5.

I am fixing this bug, but I see one thing: if I compile my app for iOS 4, and install the app in iOS 5, the unique identifier still work. My old programs have no problem in iOS 5.

So, can I say this to my boss with 100% certainty?

If I compile for iOS 4, my program will have the unique identifier for all iOS 5 devices! It will only fail when I compile my program for iOS 5 or Apple stops supporting iOS 4 (and this will take a long time)!

jscs
  • 63,694
  • 13
  • 151
  • 195
Rodrigo
  • 11,909
  • 23
  • 68
  • 101
  • You are correct, and about 95% :D Making a better question: in past time, when Apple delete something it still work for a long time? The next version still running the deleted thing correctly? – Rodrigo Sep 08 '11 at 19:32
  • 1
    possible duplicate of [UIDevice uniqueIdentifier Deprecated - What To Do Now?](http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now) – Filip Radelic Sep 08 '11 at 19:34
  • I read that, my question is a bit different. :) – Rodrigo Sep 08 '11 at 19:38

2 Answers2

2

I think the answer you want has nothing to do with iOS 5. I would tell your boss:

"As of iOS 4, UDIDs have not been deprecated. Apple has a long, strong history of deprecating functionality for at least a version before yanking the functionality completely. If Apple sticks to this established track record, there's no reason to believe that UDID support will be anything but deprecated in iOS 5 and would not be in danger of removal until iOS 6."

Also, for what it's worth, if UDID support were to vanish, most of the same functionality could be simulated by generating a UUID the first time your app is launched and stashing it to NSUserDefaults or disk for later lookup.

[Update: Though this turned out to be bad advice. Here we are at iOS 5.1 and apps that make use of UDID are already being rejected. Guess Apple's extra eager to crack down on this.]

jemmons
  • 18,605
  • 8
  • 55
  • 84
  • Good answer! The second answer is a little wrong, because I need this identifier be the same even is the user delete and reinstall the app. – Rodrigo Sep 08 '11 at 19:43
  • For persistent UUID's, you can always use a device's MAC address to identify it. – Itai Ferber Sep 08 '11 at 21:20
  • 1
    Or you could throw the generated UUID in keychain which persists across installs of the same seed. If you shared app seed's, you could even use this UUID across a suite of apps you publish. – Nathan Jones Oct 27 '11 at 02:25
1

Or, start generating your own UDIDs and use them as identifiers. Have a look on GitHub - there are a few open source generators already. Just search for UDID.

Abizern
  • 146,289
  • 39
  • 203
  • 257
  • Its because uniqueIdentifier is.. UNIQUE... I can create and save other identifier. But, if the user delete my program, i will lost it. – Rodrigo Sep 08 '11 at 19:28
  • Solutions you will find on GitHub are also unique based on device MAC address and your app ID. – Filip Radelic Sep 08 '11 at 19:32
  • If you looked at the implementations of those Open Source generators you will see that their intent is to provide a UNIQUE number to identify the device from your app. One that is unique and persistent for that device. – Abizern Sep 08 '11 at 19:33
  • Wow.. It still unique :) I will try it. – Rodrigo Sep 08 '11 at 19:35
  • This is the link to the program you said: https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5 – Rodrigo Sep 08 '11 at 21:03