从iOS 5.X开始,我曾经使用这些方法获取无线电信息: 在iOS 5.1中获取CellID,MCC,MNC,LAC和网络
但是使用iOS 8.3 beta(和8.3 GM),这个私有API
_CTServerConnectionCellMonitorCopyCellInfo
不再起作用了。
从iOS 5.X开始,我曾经使用这些方法获取无线电信息: 在iOS 5.1中获取CellID,MCC,MNC,LAC和网络
但是使用iOS 8.3 beta(和8.3 GM),这个私有API
_CTServerConnectionCellMonitorCopyCellInfo
不再起作用了。
Apple被告知他们的CoreTelephony存在缺陷,因此现在对CoreTelephony的调用失败了。他们正在检查调用者是否为沙盒,因此在调试后您可以看到:
Caller not allowed to perform action: TelephonyApiTest.240, action = sandboxed lookup, code = 1: Operation not permitted, uid = 501, euid = 501, gid = 501, egid = 501, asid = 0
但是,仍然很少有电话有效,例如:
_CTServerConnectionCopyWakeReason
_CTServerConnectionCopyVoiceMailInfo
等......我还没有尝试过。
现在最大的问题是你甚至无法获得信号强度 CTGetSignalStrength
总是返回0。
当你尝试一些像你的情况一样的resticted电话 _CTServerConnectionCellMonitorCopyCellInfo
然后你可以看到错误代码 CTError
是13(许可被拒绝)
从iOS 8.3开始,上述所有解决方案都需要有权使用
<key>com.apple.CommCenter.fine-grained</key>
<array>
<string>spi</string>
</array>
不仅单元监视器受到保护,而且似乎所有CoreTelephony通知现在都需要该权限才能工作。例如,kCTMessageReceivedNotification也受到影响。