首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Swift获取LAC和/或CellID

如何使用Swift获取LAC和/或CellID
EN

Stack Overflow用户
提问于 2018-03-12 08:03:01
回答 1查看 2K关注 0票数 1

亲爱的StackOverflow朋友们,我发现了如何为一个iOS设备获得MNC (M Network Code)和MCC (MCE 29国家E 110CE 211ode),但我确实需要获得有关CellID和LAC的信息(E 112LE 213定位代码>E 114AE 215reaE 116/code>CE 217)。这不是一个应该进入AppStore的应用程序,我们需要这个来进行内部测试。我知道,有可能让跨国公司/MCC这样:

代码语言:javascript
复制
var mob = CTTelephonyNetworkInfo()  

    if let r = mob.subscriberCellularProvider {  
        print("CountryCode: \(r.mobileCountryCode!)")  
        print("NetworkCode: \(r.mobileNetworkCode!)")  

    }  

但是,在iOS 11中是否有可能获得LAC/CellID?

EN

回答 1

Stack Overflow用户

发布于 2018-05-11 09:59:41

请检查这段代码,我已经加进去了。

代码语言:javascript
复制
import UIKit
 import CoreTelephony

class mobile: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

      let telephonyInfo: CTTelephonyNetworkInfo = CTTelephonyNetworkInfo()
      let carrierNetwork: String = telephonyInfo.currentRadioAccessTechnology!
      print("mobile network : \(carrierNetwork)")

      let carrier = telephonyInfo.subscriberCellularProvider

      let countryCode = carrier?.mobileCountryCode
      print("country code:\(String(describing: countryCode))")

      let mobileNetworkName = carrier?.mobileNetworkCode
      print("mobile network name:\(String(describing: mobileNetworkName))")

      let carrierName = carrier?.carrierName
      print("carrierName is : \(String(describing: carrierName))")

      let isoCountrycode = carrier?.isoCountryCode
      print("iso country code: \(String(describing: isoCountrycode))")

  }



}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49230555

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档