Signal strength in ios 8.3

≯℡__Kan透↙ 提交于 2019-12-11 11:48:24

问题


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);

回答1:


If you are using anything that Apple does not allow, it will certainly leads to the App rejection.



来源:https://stackoverflow.com/questions/32202014/signal-strength-in-ios-8-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!