how does an app recognize the phone? I recently used an app to enter a voucher code and then redeem it to get free stuff. But it only allows 1 code/ phone. I was wondering, what do the iOS apps use when identifying a phone/user?
There are a number of methods an app can use to uniquely identify a device or user.

Transitory (persistent whilst app is installed)


Unique identifier generated by the app and saved in a property list or other equivalent storage in the app sandbox's Library or Documents folder.
Hashed login or equivalent to determine user.
CFUUID (https://developer.apple.com/library/ios/documentation/CoreFoundation/Reference/CFUUIDRef/index.html)
identifierForVendor (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice/identifierForVendor)


Permanent


MAC address of device (not recommended by Apple for these purposes).
Advertising Identifier (can be reset in Settings; https://developer.apple.com/LIBRARY/ios/documentation/AdSupport/Reference/ASIdentifierManager_Ref/index.html#//apple_ref/occ/instp/ASIdentifierManager/advertisingIdentifier).


Deprecated


UDID (http://www.theverge.com/2013/3/21/4133288/apple-to-finally-stop-accepting-apps-that-use-outdated-udid-device-identifier-may-1st)