Is there any way of getting the mnc and mcc numbers on an iPhone?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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];
回答2:
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,