问题描述
我想在iPhone上获取IMEI。我尝试使用以下代码:
I want to get IMEI on iPhone. I try to use the following code:
#import "Message/NetworkController.h"
NetworkController *ntc=[[NetworkController sharedInstance] autorelease];
NSString *imeistring = [ntc IMEI];
但未找到NetworkController。
But NetworkController is not found.
我还发现我可以使用:
UIDevice *myDevice = [UIDevice currentDevice];
NSString *identifier = myDevice.uniqueIdentifier;
但这无法帮助我获得IMEI。
But this cannot help me to get IMEI.
关于如何在iPhone上获取IMEI的任何建议?
Any suggestion about how to get IMEI on iPhone?
推荐答案
我发现erica发布了头文件Message / NetworkController.h在ericasadun.com上。
http://ericasadun.com/iPhoneDocs300/_network_controller_8h-source.html(现已被删除)
I found that erica had posted the header file "Message/NetworkController.h" on ericasadun.com.http://ericasadun.com/iPhoneDocs300/_network_controller_8h-source.html (It's been removed now)
我创建了一个头文件,将NetworkController.h文件复制并粘贴到其中,并将私有框架Message.framework添加到我的项目,导入我创建的头文件。
I created a header file, copy and paste the NetworkController.h file into it and add the private framework "Message.framework" to my project, import the header file I created.
现在我可以使用我找到的原始方法获取imei编号。
Now I can use the original method I found to get the imei number.
NetworkController *ntc = [NetworkController sharedInstance];
NSString *imeistring = [ntc IMEI];
[已编辑]不再有效。应用程序将被Apple拒绝。相反,您将不得不使用UDID。见下面的帖子。
Doesn't work anymore. App will be rejected by Apple. Instead you will have to use UDID. See post below.
这篇关于如何在iPhone上获取IMEI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!