Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Network MNC and MCC

I know I can get the carriers Name, MNC and MCC using the following properties of the CTCarrier Class

carrierName
mobileCountryCode
mobileNetworkCode

These details are of the SIM inserted into the device. Is there a way to get similar details of the network used by the device?

Example: The SIM MCC and MNC are 404 and 02. The Network MCC and MNC could be 404 and 02, 404 and 03 etc.


Edit: Here's what I want.

I have a sim card of Vodafone of location x. The MCC and MNC is 404 and 30 respectively. Now if I travel to location y, my sim may latch to either Vodafone or some other network (sometimes called roaming)

Now I want to get the details of the network my sim is latched to!!

like image 603
Sahil Khanna Avatar asked Nov 09 '11 06:11

Sahil Khanna


People also ask

How do I find my MCC MNC?

The MCC-MNC tuple is stored within the first five or six digits of the IMSI (International Mobile Subscriber Identity). You can obtain the the MCCMNC of a cell phone number (MSISDN) by performing an HLR lookup.

What is MNC and MCC in APN?

212 defines mobile country codes (MCC) as well as mobile network codes (MNC).

What is MCC or MNC?

MCC and MNC are the acronyms of “Mobile Country Code” and “Mobile Network Code”. These codes are used to identify the country and network codes on mobile telecommunications for GSM, LTE, CDMA, or UMTS communications.

What is MCC in network?

The mobile country code (MCC) consists of three decimal digits and is defined in ITU-T recommendation E. 212. The first digit of the mobile country code identifies the geographic region. The MCC is used in combination with the mobile network code (MNC) to uniquely identify a mobile network operator.


1 Answers

In the words of John Muchow, from his article here:

With the release of iOS 4, Apple introduced two new frameworks for obtaining carrier information. CTCarrier offers information about the cellular provider including the carrier name, Mobile Network Code and Mobile Carrier Code. CTTelephonyNetworkInfo is the channel to access information through CTCarrier, this class also provides an update notifier if you need to detect changes to a changes in cellular provider information, for example, if the user swaps out there SIM card.

// Setup the Network Info and create a CTCarrier object
CTTelephonyNetworkInfo *networkInfo = [[[CTTelephonyNetworkInfo alloc] init] autorelease];
CTCarrier *carrier = [networkInfo subscriberCellularProvider];

// 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);
like image 184
Suresh D Avatar answered Oct 06 '22 22:10

Suresh D