Akhilesh Mani
Akhilesh Mani

Reputation: 3552

Get CellID and LAC programatically in iOS 10.x

I am trying to get CellID and LAC programmatically in iOS 10.x.

I tried Get CellID, MCC, MNC, LAC, and Network in iOS 5.1 but this is not working in 8.3 and above versions.

Can anyone help me to achieve this?

Upvotes: 3

Views: 957

Answers (1)

Akshay Phulare
Akshay Phulare

Reputation: 1599

//mcc
CTTelephonyNetworkInfo *netInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [netInfo subscriberCellularProvider];
NSString *mcc = [carrier mobileCountryCode];

//mnc
NSString *mnc = [carrier mobileNetworkCode];
NSLog(@"mcc: %@, mnc: %@", mcc, mnc);

Upvotes: 1

Related Questions