user2886437
user2886437

Reputation: 21

How to get IMEI Number in IOS 7 devices programmatically

I wrote the code for getting IMEI number in iPhone/iPad devices, it worked well IOS 6. Once I updated the OS version to IOS 7, app getting crash while executing IMEI number retrieval code. Is there any changes required to get the IMEI in IOS 7 devices?

Here is my code:

struct CTResult it;
CFMutableDictionaryRef kCTDict;
conn = _CTServerConnectionCreate(kCFAllocatorDefault, ConnectionCallback,NULL);
_CTServerConnectionCopyMobileEquipmentInfo(&it, conn, &kCTDict);
NSLog (@ "kCTDict is %@", kCTDict);
CFStringRef meid = CFDictionaryGetValue(kCTDict, CFSTR("kCTMobileEquipmentInfoMEID"));
NSLog (@ "kCTMobileEquipmentInfoMEID is %@", meid);
CFStringRef mobileId = CFDictionaryGetValue(kCTDict,CFSTR("kCTMobileEquipmentInfoCurrentMobileId"));
NSLog (@ "kCTMobileEquipmentInfoCurrentMobileId is %@", mobileId);

Upvotes: 1

Views: 6019

Answers (1)

user2883619
user2883619

Reputation:

I am not very sure about IMEI number in iOS7 Apple changed the way they provide the Unique Identifier. But 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 UDID. This will always return the same id across all your apps running on the same phone.

Upvotes: 1

Related Questions