문제

I have a recent requirement to find the Service Provider of the Mobile from within the iOS App. I am not very sure if this is possible.

Can someone please help me with this.

Also, if possible, please do let me know if it will clear AppStore Review.

Thanks

도움이 되었습니까?

해결책

You can get the service provider using CTTelephonyNetworkInfo and CTCarrier classes. Just do the following :

Add this headers :

#import <CoreTelephony/CTCarrier.h>
#import <CoreTelephony/CTTelephonyNetworkInfo.h>

And get service provider name :

CTTelephonyNetworkInfo *networkInfo = [[[CTTelephonyNetworkInfo alloc] init] autorelease];
NSString *serviceProvider = networkInfo.subscriberCellularProvider.carrierName;

This is a public API, you can use it on an app on the app store.

PS : Don't forget to link CoreTelephony Framework in your target.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top