如何以编程方式获取有关iphone的设备数据提供程序(如Verizon/AT& T)的详细信息? [英] How can I get details about the device data provider (like Verizon/AT&T) of an iphone programmatically?

查看:80
本文介绍了如何以编程方式获取有关iphone的设备数据提供程序(如Verizon/AT& T)的详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个ios应用程序,我想根据用户使用的数据提供者(例如Verizon和AT& T)对用户进行细分.是否有可能从ios应用程序中以编程方式获取此信息.

I am trying to create an ios application and I want to segment the users based on the data providers they are using, such as Verizon and AT&T. Is it possible to get this information programmatically from the ios application.

推荐答案

您应检查只需将CoreTelephony导入到您的Swift文件中即可.

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

这篇关于如何以编程方式获取有关iphone的设备数据提供程序(如Verizon/AT& T)的详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆