iPhone 4S上的IMEI空号码 [英] Empty IMEI Number on iPhone 4S
问题描述
我当前正在使用Erica的代码以编程方式获取iPhone IMEI号码: https://github.com/erica/uidevice-extension/blob/master/UIDevice-IOKitExtensions.m
这在iPhone 3G和4,甚至是iOS 5的iPhone 4上也能正常工作.但是,当我在iPhone 4S上尝试使用它时,它返回空.
我当前使用的代码是否需要更新,或者是否有其他方法可以在4S上获取IMEI?
最后,由于Apple将限制对唯一标识符(如IMEI和iPhone唯一ID)的访问,我不得不使用一些代码来自Georg Kitz,它根据手机的MAC地址创建一个唯一的标识符,并使用MD5进行哈希处理.
使用Georg Kitz的代码( https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5 ),我可以按照以下方式获取ID:
UIDevice * thisDevice = [UIDevice currentDevice];
thisDevice.uniqueDeviceIdentifier
I'm currently using Erica's code to get hold of the iPhone IMEI number programmatically: https://github.com/erica/uidevice-extension/blob/master/UIDevice-IOKitExtensions.m
This works fine on iPhone 3G and 4, even an iPhone 4 with iOS 5. But when I try it on a iPhone 4S, it returns empty.
Does the code I'm currently using need updating, or is there an alternate method to get the IMEI on the 4S?
In the end, due to fact that Apple is going to be restricting access to unique identifiers like the IMEI and the iPhone unique Id, I resorted to using some code from Georg Kitz which creates a unique identifier based on the MAC address of the phone, hashed using MD5.
Using Georg Kitz's code (https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5), I can simply get the Id as follows:
UIDevice * thisDevice = [UIDevice currentDevice];
thisDevice.uniqueDeviceIdentifier
这篇关于iPhone 4S上的IMEI空号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!