iphone:接到电话时通知?
我正在为越狱设备进行开发,我想创建一个应用程序来检测电话呼叫,并在呼叫屏幕顶部显示警报。我怎样才能实现这个目标?我应该使用哪些隐藏框架?
I'm developing for a jailbroken device, and I want to create an app that detects a phone call, and presents an alert on top of the call screen. How can I achieve this? What hidden frameworks should I use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CoreTelephony 中包含 CTCallCenter 类,其中包含 callEventHandler 属性,该属性是在呼叫状态发生更改时运行的块。如文档中所述,您可以使用它来获得这些状态的通知:
文档说您必须处于活动应用程序状态。如果您被暂停,那么您醒来时只会收到一个方块状态更改通知。如果您已越狱并处于后台状态,希望您的块能够被执行,这样您就可以意识到这一点。
Within CoreTelephony is the CTCallCenter class which includes the callEventHandler property, which is a block that runs upon changes in the call state. As described in the documentation, you could use this to become notified of these states:
Docs say you must be in active app state. If you are suspended, then you only get one block state change notification upon waking up. If you are jailbroken and in background state, hopefully you would get your block executed, so you could become aware of this.