12

I want to get the device id and send it into a web service. How can I get the UDID in iOS 6

Thanks

Wes Cossick
  • 2,923
  • 2
  • 20
  • 35
iDia
  • 1,397
  • 8
  • 25
  • 44

2 Answers2

26

UDID is no longer available in iOS 6+ due to security / privacy reasons. Instead, use identifierForVendor or advertisingIdentifier.

identifierForVendor:

An alphanumeric string that uniquely identifies a device to the app’s vendor. (read-only)

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

advertisingIdentifier:

An alphanumeric string unique to each device, used only for serving advertisements. (read-only)

Unlike the identifierForVendor property of UIDevice, the same value is returned to all vendors. This identifier may change—for example, if the user erases the device—so you should not cache it.

This post explains it well.

Also, see Apple's documentation for the identifierForVendor and advertisingIdentifier.

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Wes Cossick
  • 2,923
  • 2
  • 20
  • 35
  • then how to get device id for uniquely identification – iDia Nov 19 '12 at 15:37
  • I edited it. You'd use the "identifierForVendor" or the "advertisingIdentifier" – Wes Cossick Nov 19 '12 at 15:38
  • 1
    For adhoc testers, they need to be able to find their UDID so I can them to the profile. It's a pain that you can no long see the UDID from the phone. So many people no longer connect their devices to iTunes. – Roger Gilbrat Apr 18 '13 at 22:03
  • @RogerGilbrat I don't know if something changed since this post but my adhoc testers running iOS 6 get their UDID using apps on the store (such as UDID Tool) – momo Aug 28 '13 at 08:24
2

Check out OpenUDID:

OpenUDID is a drop-in replacement for the deprecated uniqueIdentifier property of the UIDevice class on iOS (a.k.a. UDID) and otherwise is an industry-friendly equivalent for iOS and Android, and most recently Windows C# and Silverlight (see links above).

Edit: Make sure since May 1st 2013 for iOS 6 to use the this Branch until the Main is updated:

quarac
  • 3,454
  • 3
  • 21
  • 25
Danoli3
  • 3,203
  • 3
  • 24
  • 35