How can I get details about the device data provider (like Verizon/AT&T) of an iphone programmatically?

You should check the CTCarrier.

Just import CoreTelephony into your Swift file.

Then you can use the carrierName property to get the name of your carrier.

// Setup the Network Info and create a CTCarrier object
let networkInfo = CTTelephonyNetworkInfo()
let carrier = networkInfo.subscriberCellularProvider

// Get carrier name
let carrierName = carrier.carrierName

You will want to use the CTCarrier carrierName in the CoreTelephony framework: https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Reference/CTCarrier/index.html#//apple_ref/occ/instp/CTCarrier/carrierName


Now that you can have multiple SIM cards, subscriberCellularProvider is deprecated in favor of serviceSubscriberCellularProviders. You can get an array of the providers with this:

CTTelephonyNetworkInfo().serviceSubscriberCellularProviders?.values

In my case, I was checking to see if the user has an American phone number so they can text support instead of email. You can do that with this:

carriers.contains { $0.isoCountryCode?.lowercased() == "us" }

On my phone, I only have one SIM card, but this array returns two values and one has all nil properties so be sure to handle that if you are inspecting them.