3

I want to use MAC address of the iphone as my unique identifier of the app. I was wondering if it changes or is it unique per device.

Thanks

IphoneBites
  • 157
  • 1
  • 7
  • 17

6 Answers6

5

Do not use the MAC address as a replacement for the UDID. Use the Identifier For Advertisers [IDFA] or the Identifier For Vendors [IDFV] instead.

p1. The MAC address is not required to be globally unique.

p2. Even when the U/L bit in the EUI-48 or EUI-64 format identifies the address as "universal," the MAC address is not required to be globally unique. All that bit really means is that the OUI is globally registered, and the organization that it identifies is assuming responsibility for registering the individual addresses that use that OUI.

p3. Seriously, the MAC address is not globally unique. Ask anybody who works in a network interoperability laboratory. Hardware manufacturers reuse them all the time, according to policies they never discuss publicly. It is not a replacement for the UDID.

p4. The operating system is under no obligation to present the actual hardware MAC address to non-privileged applications. The current version may be doing that today, but some future version might rather suddenly and silently stop doing that. It could start returning an identical address on every device.

Do not use the MAC address as a replacement for the UDID. Use the Identifier For Advertisers [IDFA] or the Identifier For Vendors [IDFV] instead.

james woodyatt
  • 2,170
  • 17
  • 17
  • 2
    In addition, MAC address will be deprecated in iOS7. Or stated another way, it will return a single value for all iOS7 clients. – Khan Jul 25 '13 at 18:42
  • 1
    Yes, in iOS 7, the MAC address of network interfaces is not available to 3rd party applications anymore. To be specific, the `getifaddrs(3)` system call [and all the other programming interfaces that normally allow for inspection of network interfaces] does not return the MAC address. Instead, it returns `02:00:00:00:00:00` to signal that the address is unspecified and not in the universal OUI space. – james woodyatt Oct 08 '13 at 21:35
1

UDID API is deprecated in iOS 5. To get a unique identifier, you need to use the MAC address

A Media Access Control address (MAC address) is a unique identifier assigned to network interfaces

PMaynard
  • 302
  • 3
  • 8
1

There are many reason not to identifier a device.

Just create a unique identifier for the installation or allow the user to create an account. Any other method to identify the device could really cause problems.

If for example someone sells there phone, then the next user will see all the data in the app from the previous user. Since you do not identify the user but the device.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • Thanks rckoenes for the reply. I thought of this before you right thats why m doing something like MD5(MAC address + myusernameofapp). – IphoneBites Jul 16 '12 at 13:26
  • It's a solution, but why even adde the MAC address? Why not just create a `UUID` and save that? – rckoenes Jul 16 '12 at 13:37
0

You can simply use the UDID Like the name said it's an Unique Device Identifier

Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
Damien Locque
  • 1,810
  • 2
  • 20
  • 42
0

I would also give a go on IMEI which is suppose to be 100% unique per phone.

BTR Naidu
  • 1,063
  • 3
  • 18
  • 45
-1

MAC address is unique in the whole world - read MAC address. Err, it should be. There're ways how to change it, but it's not a task for common user, so, yes, you can use it.

People tend to use things like OpenUDID and friends.

Go to uncle Google and search for "iOS deprecated UDID" and you can have something to read for the whole night :) Or here's some summary.

zrzka
  • 20,249
  • 5
  • 47
  • 73
  • Thnks Robert i knew udid isnt allowed anymore so wanted to use MD5(MAC address + myusername) or something like that. So will give it a shot. – IphoneBites Jul 16 '12 at 13:23
  • Feel free to use it (I mean MAC), but IMHO it will be deprecated sooner or later too. IMHO it's more sensitive information than already deprecated UDID. Just think about your app and check if you really need real unique identifier (which is always same on one device) or if you can live with generated UDID, which can't survive app removal / installation for example. There's no need to use MAC in 99.9 % cases IMHO. – zrzka Jul 16 '12 at 13:27
  • Actually my app was using udid before to identify devices now i need something else to do the trick and jst be equally unique. Also on my server ill jst be storing MD5 string of MAC+username, so apple should nt have a problem in future with the as we still doesnt have user's MAC address. – IphoneBites Jul 16 '12 at 13:35
  • 1
    MAC address will not be supported in iOS 7. – Khan Jul 25 '13 at 18:43