We are using private frameworks (which includes UIStatusBarSignalStrengthItemView.h) to calculate the cell signal strength. It works perfectly in foreground mode, but as soon as my app enters background it stops updating the cell signal strength.
The code we are using is :
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];
Please note that we are using the application for enterprise purpose, so we don't need to worry about Apple's rejection for using private frameworks.
Any help will be highly appreciated.