user2715756
user2715756

Reputation: 31

Programmatically retrieving ECID of iphone

Is there a way to find the ECID of a iPhone programmatically?

I know that this is the same question as https://stackoverflow.com/questions/4978725/calling-amdevicecopyvalue-from-mobiledeviceframework-help-please/30481898#30481898 but the answers there use IOKit which has been depreciated. so is there any other way to it.

Can this be done in iOS7?

Upvotes: 0

Views: 1346

Answers (1)

gskspurs
gskspurs

Reputation: 186

Could you give us an idea what you need the ECID for?

Apple no longer allow of the usage of unique device ID's, the best you can get is the Vendor ID see the docs here. (Assuming you are going to be submitting to the app store). Also this ID value may change on app reinstall, which may or may not be a problem for you.

The exception to this is the Advertising ID but they may only be used for serving advertisements, see here.

You could also use NSUUID to generate you own ID string, see docs here.

Also, saving whatever ID value you use in the keychain will allow persistance through app reinstalls. Keychain docs are here.

Upvotes: 2

Related Questions