1

Kia Ora friends, I know there have been a couple of topics about it, but I am still confused about the following: I want to check out MNC and MCC on iPhone, using Swift 4 on iOS 11.1. My code is the following:

var mob = CTTelephonyNetworkInfo()
if let r = mob.subscriberCellularProvider { //creates CTCarrierObject
  print(r.mobileCountryCode!)
  print(r.mobileNetworkCode!)
}

At the moment, I am just getting the following error:

Could not successfully update network info during initialization.

I am just using it in iPhone Simulator, I haven't been testing it on a real phone yet.

So does anyone know, what I need to change? And is it just an error because the Xcode Simulator cannot simulate that or will I get the same error on real devices as well? Thank you!

Community
  • 1
  • 1
Hemmelig
  • 803
  • 10
  • 22
  • You need to test on a real phone. How can you get cellular network info from a device that doesn't have a cellular network subscription (the simulator)? – Paulw11 Mar 04 '18 at 10:59
  • Ah, yes, you are right. I thought it is a simulator, because it's able to simulate that as well. – Hemmelig Mar 05 '18 at 09:39
  • Do you know, how to determinate LAC and/or CellID with the same framework and my code above? I found a couple of topics about it, but nothing for swift, as of the fact that I don't understand objective-c. – Hemmelig Mar 05 '18 at 09:40

0 Answers0