Is there a unique identifier for each iPhone / iPod Touch?

Is there a unique identifier like mac address for each iPhone / iPod Touch?

Do I need to ask the user for permission to transfer such a unique identifier?

+2


source to share


1 answer


Yes, you can get it using the UIDevice uniqueIdentifier property:

The Unique Device ID is a hash value made up of various hardware identifiers such as the serial number of the device. It is guaranteed to be unique for each device, but cannot be publicly tied to a user account. You can use it, for example, to store high scores for a game on a central server or to control access to registered products. The unique device identifier is sometimes referred to by its abbreviation UDID.

Edit: The uniqueIdentifier property was deprecated in iOS5 and you shouldn't be using it now. Alternatively, you can create your own unique ID (check out this question for example ).

Also in iOS6, Apple added 2 new methods to get a unique identifier ( NSUUID class as an example ):



UIDevice -identifierForVendor :

The value of this property is the same for applications that come from the same vendor running on the same device. A different value is returned for applications on the same device that come from different vendors and for applications on different devices associated with the merchant.

ASIdentifierManager -advertisingIdentifier :

Unlike the identifierForVendor property of UIDevice, the same value is returned to all providers. This identifier can change - for example, if the user wipes the device, so you shouldn't cache it.

+7


source







All Articles