iOS 8.3中的信号强度 [英] Signal strength in ios 8.3
本文介绍了iOS 8.3中的信号强度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Apple已限制API来获取信号强度,但我找到了一种方法来获取此信号
Apple has restricted API to fetch signal strength but there is a way to get this i found here.Is it a correct way to get signal strength. I am developing for iTunes store submission. Will apple reject my app? Solution provided by @Mateusz Mirkowski as follow :
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);
推荐答案
如果您使用Apple不允许的任何功能,肯定会导致应用拒绝.
If you are using anything that Apple does not allow, it will certainly leads to the App rejection.
这篇关于iOS 8.3中的信号强度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文