Retrieving Carrier Name from iPhone programmatically

thierryb picture thierryb · May 12, 2009 · Viewed 34.6k times · Source

Is there a way to know the cell carrier on an iPhone programmatically?

I am looking for the carrier name which the iPhone is connected to.

Answer

George Zhu picture George Zhu · Oct 16, 2010

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>