iPhone - how to determine carrier of the device (AT&T, Verizon, etc?) iPhone - how to determine carrier of the device (AT&T, Verizon, etc?) ios ios

iPhone - how to determine carrier of the device (AT&T, Verizon, etc?)


1st Import #import <CoreTelephony/CTTelephonyNetworkInfo.h> as well as #import <CoreTelephony/CTCarrier.h>(make sure you have the CoreTelephone.framework installed too).

CTTelephonyNetworkInfo *phoneInfo = [[CTTelephonyNetworkInfo alloc] init];CTCarrier *phoneCarrier = [phoneInfo subscriberCellularProvider];NSLog(@"Carrier = %@", [phoneCarrier carrierName]);[phoneInfo release];


Heres the Swift version:

import CoreTelephonylet phoneInfo = CTTelephonyNetworkInfo()let phoneCarrier = phoneInfo.subscriberCellularProviderprint(phoneCarrier?.carrierName)


While developing in Swift 3.0, You just need to import CoreTelephony in you link binary with libraries in Build phases.

// Setup the Network Info and create a CTCarrier object

 let networkInfo = CTTelephonyNetworkInfo() let carrier = networkInfo.subscriberCellularProvider

// Get carrier name

 print(carrier?.carrierName)

That's it.