【发布时间】:2015-09-07 07:15:12
【问题描述】:
我正在使用下面的代码 sn-ps 来找出用户 iPhone 的 MCC(移动国家代码)。运营商名称、iSO 代码和 MNC 等详细信息都很好,但 MCC 始终是 404,而不是 +01(或美国)或 +91(印度)。
CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [networkInfo subscriberCellularProvider];
// Get carrier name
NSString *carrierName = [carrier carrierName];
if (carrierName != nil)
NSLog(@"Carrier: %@", carrierName);
// Get mobile country code
NSString *mcc = [carrier mobileCountryCode];
if (mcc != nil)
NSLog(@"Mobile Country Code (MCC): %@", mcc);
// Get mobile network code
NSString *mnc = [carrier mobileNetworkCode];
if (mnc != nil)
NSLog(@"Mobile Network Code (MNC): %@", mnc);
NSString *code = [carrier isoCountryCode];
NSLog(@"isoCountryCode (iso): %@", code);
我的手机中有一张可以正常使用的 SIM 卡,并且我的手机已解锁。 我在这里做错了什么?
【问题讨论】:
-
MCC 不是 e.164 国家代码。这是一个 e.212 代码 - 404 是印度。 itu.int/itudoc/itu-t/ob-lists/icc/e212_685.pdf
标签: ios iphone core-telephony mobile-country-code