获取 iPhone 运营商接收状态? (不是互联网)
我需要知道用户理论上是否可以打电话。
有谁知道当用户的iPhone能够连接到运营商的网络时如何“返回true”(使用Cocoa iOS)? (不是互联网)
或者如何以编程方式告诉用户“有多少个接收格”?
I need to know if the user could theoretically make a phone call.
Does anyone know how to "return true" (using Cocoa iOS) when the user's iPhone is able to connect to the carrier's network? (not the internet)
Or how to programmatically tell "how many bars of reception" the user has?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将您的应用程序链接到 CoreTelephony.framework
您可以检查 CTCarrier 对象并查看对于需要连接的某些属性是否有有效结果 (!=nil)电话提供商。
例如,下面有一段代码,用于检查 CTCarrier 的 mobileNetworkCode 属性。当且仅当设备连接到电话提供商时,此属性为 != nil(您所需的任务,即用户能够拨打电话,包含在上述状态中)。
更多信息请参见 Apple 开发者文档网址: http ://developer.apple.com/library/IOs/#documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
Link your application against the CoreTelephony.framework
You can check the CTCarrier object and see if you've a valid result (!=nil) for some property that require a connection with the Phone Provider.
For example, below there's a snip of code that check against the mobileNetworkCode property of CTCarrier. This property is != nil if-and-only-if the device is connected to a Phone Provider (your desired task, user able to make a phone call, is included in the state described above).
more info at the Apple Developer Documentation url: http://developer.apple.com/library/IOs/#documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html