iOS:接到电话时显示警报?

编程入门 行业动态 更新时间:2024-10-13 16:17:25
本文介绍了iOS:接到电话时显示警报?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我希望在接到电话时触发本地通知(并显示警报) - 这可能吗?呼叫事件能否启动应用程序或触发通知?

I would like a local notification to be fired when a call is received (and to show an alert) - is this possible? Can a call event get an app to launch or a notification to be fired?

Skype 是如何被解雇的?使用推送通知?

How is skype fired? With push notifications?

谢谢

推荐答案

如果您的应用程序在调用时正在运行,请查看 CoreTelephony 框架.CTCall 类提供有关呼叫状态的信息.我自己没有用过这个,但你可能会发现它很有用.

If your application is running while a call is in place check out the CoreTelephony Framework. The CTCall class provides information about the call state. I have not used this myself but you may find it useful.

extern NSString const *CTCallStateDialing; extern NSString const *CTCallStateIncoming; extern NSString const *CTCallStateConnected; extern NSString const *CTCallStateDisconnected;

CTCallCenter 允许您注册呼叫事件状态更改.正如我之前所说,您的应用程序需要运行才能知道某些事情发生了变化.当您的应用程序移至后台时,您可能想要请求最大后台时间(我认为现在是 10 分钟).这些 api 仅在 iOS 4.0 及更高版本中可用.

The CTCallCenter allows you to register for call event state changes. As I said before your application will need to be running to know that something has changed. You may want to request the maximum backgrounding time (I think it is 10 minutes now) when your application is moved to the background. These api's are only available in iOS 4.0 and later.

更多推荐

iOS:接到电话时显示警报?

本文发布于:2023-11-27 22:03:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639769.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:警报   电话   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!