iPhone에서 iMei를 얻는 방법?
-
05-07-2019 - |
문제
iPhone에서 Imei를 얻고 싶습니다. 다음 코드를 사용하려고합니다.
#import "Message/NetworkController.h"
NetworkController *ntc=[[NetworkController sharedInstance] autorelease];
NSString *imeistring = [ntc IMEI];
그러나 NetworkController는 찾을 수 없습니다.
또한 다음을 사용하여 고유 한 식별기를 얻을 수 있음을 알 수 있습니다.
UIDevice *myDevice = [UIDevice currentDevice];
NSString *identifier = myDevice.uniqueIdentifier;
그러나 이것은 내가 Imei를 얻는 데 도움이 될 수 없습니다.
iPhone에서 iMei를 얻는 방법?
해결책
더 이상 iPhone에서 imei를 얻을 수 없습니다. 대신 UDID를 사용해야 할 수도 있습니다. 다른 답변을 참조하십시오.
과거에는 Ericasadun.com에 게시 된 헤더 파일 "Message/NetworkController.h"를 사용할 수 있습니다.http://ericasadun.com/iphonedocs300/_network_controller_8h-source.html (지금 제거되었습니다)
NetworkController.h 파일과 개인 프레임 워크 "Messag
NetworkController *ntc = [NetworkController sharedInstance];
NSString *imeistring = [ntc IMEI];
그 핵은 더 이상 작동하지 않습니다. 앱은 Apple에 의해 거부됩니다.
다른 팁
iPhone에서 프로그래밍 방식으로 IMEI를 찾을 수 없습니다.
그것을 얻는 공식적인 방법은 없지만 사과에서 개인 프레임 워크 CoreTelephony.framework
방법이 있습니다 CTGetIMEI
도움이 될 수 있습니다.
쉽게 할 수없는 이유가 있다고 확신합니다. Auto-Unlocker 앱? 나는 그렇게 생각하지 않습니다. 나는 Apple과 AT & T가 그것을 너무 좋아하지 않을 것이라고 확신합니다.
*# 06#은 수동으로 얻는 방법입니다.
나는 여기에서 stackoverflow에서만 검색했고 결론은 Apple이 iOS 6 이후에 전화 emei를 더 이상 찾을 수 없다는 것입니다.
UDID를 사용하여 장치를 식별 할 수 있습니다. 여기서 내 대답을 찾았습니다 https://stackoverflow.com/a/19927376/2283308
프로젝트에 "Coretelephony.h"를 추가하십시오.
Coretelephony.h
struct CTServerConnection
{
int a;
int b;
CFMachPortRef myport;
int c;
int d;
int e;
int f;
int g;
int h;
int i;
};
struct CTResult
{
int flag;
int a;
};
struct CTServerConnection * _CTServerConnectionCreate(CFAllocatorRef, void *, int *);
void _CTServerConnectionCopyMobileIdentity(struct CTResult *, struct CTServerConnection *, NSString **);
수업에 다음 코드를 추가하십시오
#import "CoreTelephony.h"
struct CTServerConnection *sc=NULL;
struct CTResult result;
void callback() { }
이제 Imei를 쉽게 얻을 수 있습니다
NSString *imei;
_CTServerConnectionCopyMobileIdentity(&result, sc, &imei);