tags:

views:

524

answers:

3

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

+1  A: 

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.

Brent Royal-Gordon
Thanks for the response - sadly Location Services requires asking the user, in the sense that they get a popup asking if it's ok.
Airsource Ltd
A: 

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

Phill Pafford
A: 

Added in iOS4

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

http://developer.euro.apple.com/iphone/library/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html

koregan