Airsource Ltd
Airsource Ltd

Reputation: 32642

How can I get the MCC and MNC on an iPhone

As per the subject - is there an API to get the MCC/MNC on iPhone OS 2.1 or above?

Upvotes: 5

Views: 19674

Answers (3)

koregan
koregan

Reputation: 10164

Added in iOS4

CTTelephonyNetworkInfo *netInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netInfo subscriberCellularProvider];
NSString *mcc = [carrier mobileCountryCode];
NSString *mnc = [carrier mobileNetworkCode];

http://developer.apple.com/library/ios/#Documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html

Upvotes: 31

Phill Pafford
Phill Pafford

Reputation: 85358

I think you could just get the phone number of the iPhone and parse it out for the country code.

Upvotes: 0

Becca Royal-Gordon
Becca Royal-Gordon

Reputation: 17861

No, mobile network information is not available through the API. If you're looking for a unique device ID, take a look at UIDevice's uniqueIdentifer method; if you're looking for the country the device is in, you need Location Services; if you want a good indication of the user's home region, take a look at NSLocale; for anything else, just ask the user.

Upvotes: 1

Related Questions