Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Mobile Country and Network code on an iPhone

Is there any way of getting the mnc and mcc numbers on an iPhone?

like image 522
Johan Avatar asked Apr 01 '10 09:04

Johan


2 Answers

You need the CoreTelephony framework

CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [networkInfo subscriberCellularProvider];

to get MNC,

NSString *mnc = [carrier mobileNetworkCode];

to get MCC,

NSString *mcc = [carrier mobileCountryCode];
like image 73
honcheng Avatar answered Oct 04 '22 07:10

honcheng


You can use the methods of the CTCarrier class to retrieve Country and network code. However this is only for the home provider (=SIM Card) and not the provider the phone is currently booked in,

like image 29
holtmann Avatar answered Oct 04 '22 06:10

holtmann