检查 iPhone 中的来电
我已阅读有关 CoreTelephony 类,在此 CTClass 可以检查调用者并查找调用状态......
但是何时以及如何使用它......
我认为我的应用程序在什么时候进入后台呼叫开始..
请帮助或纠正我......
I have read about the CoreTelephony class and in this CTClass can check caller and find state of call....
But when and how to use this......
I think my application goes to background when call start..
help please or correct me......
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用官方 SDK 是不可能的。您能做的最好的事情就是确定用户是否正在通话。您可以通过检查状态栏框架的大小来做到这一点。
It is not possible with the official SDK. The best that you can do is determine if the user is on a call. You can do this by inspecting the size of the status bar frame.
如果您询问是否可以在后台跟踪电话,则在所有情况下都不能。
如果您想知道在任何时间点跑步时是否可以。您可以访问“CTCallCenter”currentCalls 属性,它将为您提供该时间点的呼叫状态。
如果您想跟踪传入呼叫是否是您的应用程序进入后台的原因,您可以使用“CTCallCenter”callEventHandler 属性。
If your asking if you can track phone calls in the background, you can't in all situations.
If you want to know if, at any point in time, when your running, you can. You can access the 'CTCallCenter' currentCalls property and it will give you the state of the call at that point in time.
If you want to track if a incomming call the cause of your application going to the background, you can use the 'CTCallCenter' callEventHandler property.
不太确定您想要完成什么,但通话结束后,用户应该自动返回到应用程序。
Not quite sure what you're trying to accomplish but after the call ends the user should automatically be brought back to the app.
使用当前的 SDK 无法获取此信息,很可能是出于隐私原因。我建议向 Apple (http://radar.apple.com) 提交功能请求,但是我怀疑他们将来可能会包含此功能。
It's not possible to get this information with the current SDK, most likely for privacy reasons. I'd recommend filing a feature request with Apple (http://radar.apple.com) however, I doubt it's something they're likely to include in the future.