How to get Mobile Country and Network code on an i

2020-06-17 02:03发布

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

2条回答
来,给爷笑一个
2楼-- · 2020-06-17 02:20

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,

查看更多
劳资没心,怎么记你
3楼-- · 2020-06-17 02:31

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];
查看更多
登录 后发表回答