亲爱的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这样:
var mob = CTTelephonyNetworkInfo()
if let r = mob.subscriberCellularProvider {
print("CountryCode: \(r.mobileCountryCode!)")
print("NetworkCode: \(r.mobileNetworkCode!)")
} 但是,在iOS 11中是否有可能获得LAC/CellID?
发布于 2018-05-11 09:59:41
请检查这段代码,我已经加进去了。
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))")
}
}https://stackoverflow.com/questions/49230555
复制相似问题