Using UDID to create unique user identity

11,060

Solution 1

Yes, it's allowed, but take into account what I have reported below, from the documentation.

You can retrieve the UDID as follows:

NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];

Note the following from the offical Apple's documentation:

A device’s unique identifier (sometimes abbreviated as UDID for Unique Device Identifier) is a hash value composed from various hardware identifiers such as the device serial number. It is guaranteed to be unique for each device. The UDID is independent of the device name. For devices that use a SIM (subscriber identity module) card, the UDID is independent of the SIM card.

For user security and privacy, you must not publicly associate a device’s unique identifier with a user account.

You may use the UDID, in conjunction with an application-specific user ID, for identifying application-specific data on your server. For example, you use could a device-user combination ID to control access to registered products or when storing high scores for a game in a central server. However, if you are developing a game, you may want to instead use Game Center’s player identifier key as explained in Game Kit Programming Guide.

Important: Never store user information based solely on the UDID. Always use a combination of UDID and application-specific user ID. A combined ID ensures that if a user passes a device on to another user, the new user will not have access to the original user’s data.

Solution 2

I've used the UDID for checking if the device already has a running subscription. Getting the UDID is easy:

NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];

If you read up on the App store rules, there is a section about letting the user create an account to move the subscriptions to an other device. In this section Apple makes clear that the account creation must be an username and password that the user must enter. The username can't be an e-mail address since it is personal information.

If you app leans heavy on the data, an optional user account creation would be advisable.

The AppStore Review guidelines can by found : http://developer.apple.com/appstore/resources/approval/guidelines.html

Solution 3

UDID is hidden since iOS-6 and later so you can uniquely identify device by:

NSString *UDID = [[UIDevice currentDevice] identifierForVendor];
Share:
11,060

Related videos on Youtube

tamasgal
Author by

tamasgal

My name is Tamás Gál, I am an astroparticle physicist and working at Erlangen Centre for Astroparticle Physics (ECAP). I currently develop online monitoring and live reconstruction algorithms for the KM3NeT neutrino telescopes and maintain the IT services of KM3NeT and ECAP. My DevOps engineering skills include Docker (+Swarm), GitLab CI/CD, Jenkins, Xen, OpenVZ, Ansible and more than two decades of experience with Linux and BSD as system administrator. I spend most of my time with science (astroparticle physics), coding (Julia, Python, …) and electronics (both analog/digital); the rest preferably off the road with one of my motorbikes. I have an obsession to repair things and keep them alive as long as possible, no matter if it requires a gearbox restoration of my BMW R1100 GS or replacing a dead 0201 SMD capacitor on a MacBook logicboard. Furthermore, I love making music and spend a lot of time on my DIY modular synthesizer. #SOreadytohelp

Updated on October 29, 2020

Comments

  • tamasgal
    tamasgal over 3 years

    I am working on an iPhone App which communicates with a Server to store and exchange data. Since I would like to make it as simple as possible, I want to avoid registration (or mybe also the using of a password) for the user account. Is it possible (and allowed?) to get the UDID of the iPhone device and make eg. an MD5-hash of it, which I transfer to the server and use it for authentification? Since this ID is unique I could simply use it to login and get the user specified data from the server, without any need of creating login data.

    Is it allowed to access the UDID, make an MD5-hash of it and store it in a database?

    Second question is: how do I get the UDID? ;-)

    • phi
      phi about 13 years
      I guess you mean the UDID, right? Maybe this is the reason you could not find similar questions and answers like this one :)
  • Kai Huppmann
    Kai Huppmann about 13 years
    Could you please add a link to the mentioned subscription rule at apple.
  • d.ennis
    d.ennis almost 12 years
    [[UIDevice currentDevice] uniqueIdentifier] is deprecated in iOS 5.0, use CFUUIDCreate() instead!