Retrieving Carrier Name from iPhone programmatically Retrieving Carrier Name from iPhone programmatically ios ios

Retrieving Carrier Name from iPhone programmatically


In iOS 4, the CoreTelephony framework is useable, here's a snippet to get the carrier name:

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

Link against CoreTelephony and include in your headers:

#import <CoreTelephony/CTTelephonyNetworkInfo.h>#import <CoreTelephony/CTCarrier.h>


Just to make a note here.. I tested this API on different SIMs and it seems that the name of the operator the iPhone is locked to is returned with [carrer carrierName]!!

I tested this on 2 iphones, one locked and the other not, and for the locked one, regardless of the SIM provider, it returns the name of the operator it is locked to everytime i run my test app. Note however that the MNC does change!


For swift users you can try this:

import CoreTelephonystatic var carrierName:String? {    let networkInfo = CTTelephonyNetworkInfo()    let carrier = networkInfo.subscriberCellularProvider    return carrier?.carrierName}