Get IMEI for iOS7 programmatically

Carlos Aguirre Tradeco picture Carlos Aguirre Tradeco · Sep 21, 2013 · Viewed 13.5k times · Source

in XCode 4.6, iOS 6.1, we use CoreTelephony to obtain IMEI, the same way mentioned in get IMEI on iPhone with CoreTelephony? question, but after switching to iOS7 and XCode 5 it doesn't work anymore. My system considers IMEI as an unbreakable way to identify a cellphone and guarantee it is linked to a specific user, also other security issues depend on this identifier. With the new iOS the code is not working and we hadn't found a way to obtain it.

My central question is: What options do I have to obtain IMEI in iOS7 / XCode 5?

Variations are: - How else could I guarantee a cellphone belongs to a specific person? Identity is very important in my system and ownership of device is a requisite. - What other options do we have to keep secure the system without the need to rewrite too much?

Answer

qwiboo picture qwiboo · Sep 21, 2013

You should not be getting IMEI in first place as you're using private API and this is against Apple rules.

To get unique identifier for device you should use identifierForVendor method. This will always return the same id across all your apps running on the same phone. See apple docs for more detail.