1

The function

[[UIDevice currentDevice] uniqueIdentifier]

Is deprecated in iOS 5 and I found the solution in this project using the MAC address: https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5

Ok, it is solved. But now I discovery that iOS 5 CHANGED the format of code that uniqueIdentifier return.

In iOS 4.x it is in this format:

93F38DEB-3C0B-5C09-B746-0DFDFDDB297C

Now the iOS 5, the same function return in this format:

93f38deB3c0b5c09b7460dfdfddb297c

Anyone know if the code changed at all? It is different only is format or the code in really different for the same device?

Rodrigo
  • 11,909
  • 23
  • 68
  • 101

4 Answers4

1

A MAC Address is a (supposedly) globally unique identifier attached to a network interface, though they can be changed in many ways.

The uniqueidentifier that Apple used to provide access to was attached to the device hardware and not changeable, which made it excellent for tracking a user across apps and sessions. That's also the reason Apple is removing it, if I had to guess. Not having a way to track users across apps and sessions increases a user's privacy on their devices.

I wouldn't be surprised if Apple removes access to the MAC Address eventually for the same reasons, so it might benefit you to examine other options for tracking devices.

Community
  • 1
  • 1
phloopy
  • 5,563
  • 4
  • 26
  • 37
  • How can you change the MAC Address? Replacing the Network interface controller will obvious change it, what other way? – Rodrigo Oct 25 '11 at 19:11
  • @Rodrigo: AFAIK, jailbroken devices allow changing MAC address programmatically. – matm Oct 25 '11 at 21:20
  • @Rodrigo: It would depend on the device you're wanting to change it on. For iOS it would definitely have to be jailbroken, but might be as simple as executing `ifconfig en0 ether 01:23:45:67:89:0A` as root. I haven't tested that to be sure it would work, but I've changed my MAC on other hardware many times. – phloopy Oct 26 '11 at 22:26
0

[[UIDevice currentDevice] uniqueIdentifier] will still give you the same result as before. The project that you link to is not a 1:1 replacement, it is an alternative that gives you a similar solution using a different implementation, thus the two string are different.

hypercrypt
  • 15,389
  • 6
  • 48
  • 59
  • That are 2 different codes of 2 devices :) I solve this now. I can't test now this function in one iOS 4 than update the same device and test in iOS 5 – Rodrigo Oct 25 '11 at 19:00
0

You shouldn't use unique identifier on iOS 5. That's all you need to know.

The unique identifier on iOS was always something redundant and a big security threat. Other operating systems don't have unique identifiers and they can live without them.

  1. You can always generate unique identifiers on your server and send them to your device.
  2. You can always generate them from some unique system property (e.g. MAC), using system functions. On iOS you can create a unique identifier using CFUUIDCreate. This identifier is unique across devices and across time (you'll get a different identifier every time you call it) but you can save them (e.g. into keychain).
Sulthan
  • 128,090
  • 22
  • 218
  • 270
  • I need use a unique identifier. I solve my problem using mac address, but will be good if I get the old unique identifier. – Rodrigo Jan 05 '12 at 13:22
  • No, I don't work for Apple. The internal format of an UUID is not something you need to understand and since iOS 5 UUID shouldn't concern you at all. – Sulthan Jul 09 '12 at 14:36
-3

The code CHANGED!!!!!

UniqueIdentifier is no more UNIQUE!!!

The first format have 36 hexa lenght

93F38DEB-3C0B-5C09-B746-0DFDFDDB297C

The second have 40 hexa!!!!!

Because this, it changed. I don't know if it append more hexa to identifier, but the bigger size changed al all.

Rodrigo
  • 11,909
  • 23
  • 68
  • 101
  • No, it isn't. The old code have 36 hexas with the dashes (so the correct is 32 hexas), the new have 40 hexas without any dashes. – Rodrigo Jun 26 '12 at 20:12
  • This isn't really an answer! – RedYeti Apr 05 '13 at 10:32
  • This was in the transition between iOS 4 to ios 5. They changed the code. This was a really head pain to me. Now this is not a problem. – Rodrigo Apr 05 '13 at 20:02