How to get cell id using private apis in ios 8.3 as previous core telephony private apis are not working in latest ios sdk 8.3.
Asked
Active
Viewed 5,351 times
2 Answers
5
You can still use this. It's working on iOS 8.3. I don't know how to get signal strength. Apple has changed many things in Core Telephony lately. :(
CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
NSString *carrierNetwork = telephonyInfo.currentRadioAccessTechnology;
NSLog(@"Mobile Network): %@", carrierNetwork);
CTCarrier *carrier = [telephonyInfo subscriberCellularProvider];
NSString *mobileCountryCode = [carrier mobileCountryCode];
NSLog(@"Mobile Country Code (MCC): %@", mobileCountryCode);
NSString *mobileNetworkCode = [carrier mobileNetworkCode];
NSLog(@"Mobile Network Code (MNC): %@", mobileNetworkCode);
NSString *carrierName = [carrier carrierName];
NSLog(@"Mobile Network name: %@", carrierName);
NSString *isoCountryCode = [carrier isoCountryCode];
NSLog(@"Mobile Network isoCode: %@", isoCountryCode);
Edit: I found solution how to get signal strength. *! Please note that the solution below makes use of private API and as such will be rejected by Apple when submitted to the App Store.
UIApplication *app = [UIApplication sharedApplication];
NSArray *subviews = [[[app valueForKey:@"statusBar"] valueForKey:@"foregroundView"] subviews];
NSString *dataNetworkItemView = nil;
for (id subview in subviews) {
if([subview isKindOfClass:[NSClassFromString(@"UIStatusBarSignalStrengthItemView") class]]) {
dataNetworkItemView = subview;
break;
}
}
int signalStrength = [[dataNetworkItemView valueForKey:@"signalStrengthRaw"] intValue];
NSLog(@"signal %d", signalStrength);

Adam Buchanan Smith
- 9,422
- 5
- 19
- 39

Mateusz Mirkowski
- 173
- 1
- 11
-
From this I can only get MNC and MCC but I am looking for cell id, LAC and signal strength which was available using private apis befor 8.3 but not working now in new upgrade. Any update for the same? – Pooja Maha Apr 23 '15 at 10:56
-
1I know that this post is older but was wondering if anybody has found a solution for this problem – RockPaperScissors Jun 05 '15 at 14:16
-
Nope. There is a solution, but works only on jailbroken devices. – Mateusz Mirkowski Jul 20 '15 at 10:13
-
I have found solution how to get signal strength!!! It's working on iOS 8.3. Check edited answer. – Mateusz Mirkowski Jul 23 '15 at 09:37
-
Thanks @Mateusz Mirkowski...for MCC, MNC. But how to get LAC and Cell ID ? – Keyur Akbari Aug 10 '15 at 12:08
-
@MateuszMirkowski its great answer but will it accepted by apple for submission. – Pooja Maha Aug 24 '15 at 12:49
-
1Yes it will be rejected by apple, because it's using private variables. – Mateusz Mirkowski Sep 16 '15 at 15:04
0
Get CellID, MCC, MNC, LAC, and Network in iOS 5.1
you can visit the above link, and it can get the lac and cell below ios 8.2. if you want to get lac and cell above ios 8.3, you should add the entitlement:
<key>com.apple.CommCenter.fine-grained</key>
<array>
<string>spi</string>
</array>
also, it says your phone need jailbreak.
But really, i can not try on the real phone. if you succeeded , just share, thanks.