我编写了在 iPhone/iPad 设备中获取 IMEI 号码的代码,它在 IOS 6 上运行良好。一旦我将操作系统版本更新到 IOS 7,应用程序在执行 IMEI 号码检索代码时崩溃。在 IOS 7 设备中获取 IMEI 是否需要进行任何更改?
这是我的代码:
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);