Get Network MNC and MCC
Asked Answered
U

2

7

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!!

Usn answered 9/11, 2011 at 6:47 Comment(0)
M
2

It doesn't look like it's currently possible (iOS 5.0).

The CoreTelephony framework is where you would find this API, and as you (and Apple's documentation) mention, the CTCarrier properties only get you details for the user's cellular service provider, not the current network.

You should file an enhancement request with Apple at http://bugreport.apple.com and hopefully they include what you're looking for in a future OS update.

Out of curiosity, what are you trying to do with this information?

Madelyn answered 9/11, 2011 at 15:25 Comment(1)
The business requirement of the application is to gather information of all cellular networks the device has used. Of course, the application needs to be running.Usn
D
4

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);
Dreadful answered 9/11, 2011 at 9:11 Comment(2)
@World: This doesn't answer my question. The details are the same as in the question. You've just added an example!! My question here is "Is there a way to get similar details of the network used by the device?" Here network refers to the current network and not the SIM carrierUsn
@Sahil Then gimme the clear detail of your question.. still i didn't get, what your expecting..??Dreadful
M
2

It doesn't look like it's currently possible (iOS 5.0).

The CoreTelephony framework is where you would find this API, and as you (and Apple's documentation) mention, the CTCarrier properties only get you details for the user's cellular service provider, not the current network.

You should file an enhancement request with Apple at http://bugreport.apple.com and hopefully they include what you're looking for in a future OS update.

Out of curiosity, what are you trying to do with this information?

Madelyn answered 9/11, 2011 at 15:25 Comment(1)
The business requirement of the application is to gather information of all cellular networks the device has used. Of course, the application needs to be running.Usn

© 2022 - 2024 — McMap. All rights reserved.