質問

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