A for Alpha
A for Alpha

Reputation: 2912

CoreTelephony framework returns 404 as MCC (mobile country code) in iPhone

I am using the below code snippets to find out the MCC (mobile country code) of the user's iPhone. Details like carrier name, iSO code and MNC are coming fine but the MCC is always 404 instead of +01 (or USA) or +91(for India).

    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);

I have a perfectly working SIM card in my phone and my phone is unlocked. What am i doing wrong here ?

Upvotes: 1

Views: 926

Answers (1)

Mindaugas
Mindaugas

Reputation: 1735

MCC is not phone's country prefix as you expect, but it is mobile country code as defined by ITU-T Recommendation E.212, “List of Mobile Country or Geographical Area Codes.”

In your case 404 is - India. You can check the list at: http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.212A-2010-PDF-E.pdf

Upvotes: 2

Related Questions