#import
#import
// Setup the Network Info and create a CTCarrier object
CTTelephonyNetworkInfo *networkInfo = [[[CTTelephonyNetworkInfo alloc] init] autorelease];
CTCarrier *carrier = [networkInfo subscriberCellularProvider];
// Get carrier name
NSString *carrierName = [carrier carrierName];
if (carrierName != nil)
NSLog(@"Carrier: %@", carrierName);
// Get mobile country code
NSString *mcc = [carrier mobileCountryCode];
if (mcc != nil)
NSLog(@"Mobile Country Code (MCC): %@", mcc);
// Get mobile network code
NSString *mnc = [carrier mobileNetworkCode];
if (mnc != nil)
NSLog(@"Mobile Network Code (MNC): %@", mnc);
iOS Blog
Apple Documentation
Comments
Post a Comment