How can I get the MCC and MNC on an iPhone

前端 未结 3 1020
南旧
南旧 2020-12-17 04:23

As per the subject - is there an API to get the MCC/MNC on iPhone OS 2.1 or above?

3条回答
  •  臣服心动
    2020-12-17 04:50

    Added in iOS4

    CTTelephonyNetworkInfo *netInfo = [[CTTelephonyNetworkInfo alloc] init];
    CTCarrier *carrier = [netInfo subscriberCellularProvider];
    NSString *mcc = [carrier mobileCountryCode];
    NSString *mnc = [carrier mobileNetworkCode];
    

    http://developer.apple.com/library/ios/#Documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html

提交回复
热议问题