user1280350
user1280350

Reputation:

iOS: Find Service Provider of the Mobile from within the App

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

Upvotes: 4

Views: 840

Answers (1)

Marcio
Marcio

Reputation: 2107

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.

Upvotes: 3

Related Questions