iOS 获取蜂窝信号强度

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qcx321/article/details/52958468

调用CoreTelephony.framework的私有函数“CTGetSignalStrength”能够获取信号,如下:

int getSignalStrength()
{
void *libHandle = dlopen("/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony", RTLD_LAZY);
int (*CTGetSignalStrength)();
CTGetSignalStrength = dlsym(libHandle, "CTGetSignalStrength");
if( CTGetSignalStrength == NULL) NSLog(@"Could not find CTGetSignalStrength"); 
int result = CTGetSignalStrength();
dlclose(libHandle);
return result;
}
展开阅读全文

没有更多推荐了,返回首页