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?
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With