How to get Mobile Country and Network code on an iPhone

北城余情 提交于 2019-12-21 04:21:46

问题


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,



来源:https://stackoverflow.com/questions/2559449/how-to-get-mobile-country-and-network-code-on-an-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!