How to Get CellID, MCC, MNC, LAC, and Network in iOS 13 from Objective c?

How to Get CellID, MCC, MNC, LAC, and Network in iOS 13 from Objective c?


Some of this information is available via Core Telephony but most of it is simply not available to iOS apps.

Are you, perchance, working on behalf of a cellular carrier?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Hi,

When I try get data from core Telephony getting those details only for celluar Network . When it ry in Wifi getting empty values .

Carrier name: [Jio]

Mobile Country Code: [405]

Mobile Network Code:[869]

ISO Country Code:[in]

Allows VOIP? [YES]

When it ry in Wi-Fi getting empty values .

I’m confused. Things like the MNC are properties of cellular. How does Wi-Fi come into this?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

As you discovered you can only get Carrier name, MCC, MNC, and Country code. CellID, LAC etc are not exposed via the public APIs.

This is working for me. Specifically, this code:

class MainViewController: UIViewController {

    let t = CTTelephonyNetworkInfo()
    
    func test() {
        print(UIDevice.current.systemVersion)
        for (id, carrier) in t.serviceSubscriberCellularProviders ?? [:] {
            print("\(id):")
            print("  \(carrier.mobileNetworkCode ?? "-")")
            print("  \(carrier.mobileCountryCode ?? "-")")
            print("  \(carrier.isoCountryCode ?? "-")")
        }
    }
    
    … other view controller stuff …
}

prints:

14.7.1
0000000100000001:
  NN
  CCC
  gb
0000000100000002:
  -
  -
  -

where NN and CCC are the codes for my cellular service (which I’ve redacted here for privacy reasons).

As you can see, I’m running this on iOS 14.7.1. This is an iPhone 12 mini (hence the dual SIM) and I built my app with Xcode 12.5 on macOS 11.5.2.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to Get CellID, MCC, MNC, LAC, and Network in iOS 13 from Objective c?
 
 
Q