We are using this to get the MCC & MNC
let networkInfo = CTTelephonyNetworkInfo()
var carrier: [String:CTCarrier]? = nil
if #available(iOS 13.0, *) {
guard let str = networkInfo.dataServiceIdentifier else {
UIApplication.shared.endBackgroundTask(bgTask)
return ("","") }
carrier = networkInfo.serviceSubscriberCellularProviders
let ctCarrier = carrier?[str]
guard let _ = ctCarrier?.mobileCountryCode, let _ = ctCarrier?.mobileNetworkCode else {
UIApplication.shared.endBackgroundTask(bgTask)
return ("","")}
UIApplication.shared.endBackgroundTask(bgTask)
//NewChanges
return ((ctCarrier?.mobileCountryCode ?? ""), (ctCarrier?.mobileNetworkCode ?? ""))
//return ((ctCarrier?.mobileCountryCode!)!, (ctCarrier?.mobileNetworkCode!)!)
}