Search code examples
iphoneiossdkuitextfieldudid

Check a Server for a matching UDID and autofill UITextField with matching Username


This is my first post on here so be nice :) I am new to coding iOS and currently coding an app which uses a login system which communicates with the server and saves a users UDID. I need to app to check the UDID is on the server and if it matches to auto fill the Username UITextField in the login form.

Please could someone help me out or point me in the right direction.


Solution

  • GitHub already has a solution to UIDevice uniqueidentifier being dropped: https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5

    Project Description:

    Description

    Apple stopped supporting a unique identifier for iOS. This source code solves the problem. It generates a unique identifier based on the mac address of the device in combination with the bundle identifier.

    What you need to do:

    copy NSString+MD5Addition and UIDevice+IdentifierAddition to your project.

    use [[UIDevice currentDevice] uniqueDeviceIdentifier] to retrieve the unique identifier or

    use [[UIDevice currentDevice] uniqueGlobalDeviceIdentifier] to retrieve a global unique identifier (used for tracking between different apps).

    have fun and follow twitter.com/gekitz ;)

    //Thanks to Erica Sadun for her UIDevice+Hardware Addition (used for the mac address retrieval).