Getting carrier's name with CoreTelephony returns just "Carrier"
Asked Answered
K

2

10

I tried getting carrier name with this code (using CoreTelephony):

CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netinfo subscriberCellularProvider];
NSLog(@"Carrier Name: %@", [carrier carrierName]);

It returns "Carrier". If i go to iPhone settings my carrier's name is correct there. My iOS on the phone is v4.2.1.

What am i doing wrong?

Kiri answered 19/5, 2011 at 8:28 Comment(2)
I am also facing same issue..did u fix the issue? @KiriGrogan
Does this Apple review safe?Forcefeed
I
2

Do you really get string "Carrier" or is the string empty? Documentation says:

The value for this property is nil if any of the following apply:

The device is in Airplane mode. There is no SIM card in the device. The device is outside of cellular service range.

Bet it's empty also in simulator.

Anyway, you should be checking mobileNetworkCode, since names are rarely correct (at least in Europe, where operators come and go changing their names quite often).

Impeccant answered 6/1, 2012 at 12:55 Comment(0)
M
1

by this, you can get mobile Network code, mobile country code . from these values you can specify which sim name is this.

CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier* carrier = info.subscriberCellularProvider;
NSString *mobileCountryCode = carrier.mobileCountryCode;
NSString *carrierName = carrier.carrierName;
NSString *isoCountryCode = carrier.isoCountryCode;
NSString *mobileNetworkCode = carrier.mobileNetworkCode;

and you can make web service for this to specify which carrier name of the network, this parameter belongs to. these parameters can be uniquely identified from this wikipedia.

for example, my country code is "410", my carrier network is "06" and it correctly identifies my carrier name.

I was also stuck at the same issue and now solved

Mamelon answered 17/5, 2014 at 11:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.