Signal strength in ios 8.3

2019-08-10 07:31发布

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条回答
欢心
2楼-- · 2019-08-10 08:06

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

查看更多
登录 后发表回答