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

查看:128
本文介绍了如何以编程方式获取有关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 programatically from the ios application. Thanks in advance.

推荐答案

您应该检查 CTCarrier

You should check the CTCarrier.

只需将 CoreTelephony 导入您的Swift文件。

Just import CoreTelephony into your Swift file.

然后您可以使用 CARRIERNAME 财产以获取运营商的名称。

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天全站免登陆