Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mobileNetworkCode returns "VZW" instead of the numeric mobile network code

Tags:

ios

iphone

I have tried this code:

CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netinfo subscriberCellularProvider];
if(carrier != nil)
{
    NSString *mnc = [carrier mobileNetworkCode];
    NSLog(@" mnc is %@ ", mnc);
}

It works as I expected when the carrier is AT&T. I got mnc is 410.

However, when the carrier is Verizon. I got "mnc is VZW". Is this a correct behavior of the API? Any other way that I can obtain the numeric mobile network code?

note: Apple's documentation says the method should return...

A read-only NSString object that represents the numeric mobile network code for the user’s cellular service provider.

I'm not sure what I have done wrong or something's wrong with my phone :-)

like image 604
pt2121 Avatar asked Apr 08 '13 19:04

pt2121


1 Answers

Not sure what model u use. I also got VZW when testing with iPhone 4 (iOS 6). AFAIK, it's the only way to get MNC.

like image 100
patrick Avatar answered Nov 01 '22 03:11

patrick