简体   繁体   English

如何制作响应OnRing事件的iPhone应用程序?

[英]How can I make an iPhone app that responds to the OnRing event?

I want to write a iPhone application, it needs to react to the onRing event (or whenever someone calls, regardless of their ring/vibrate settings). 我想编写一个iPhone应用程序,它需要对onRing事件做出反应(或者无论何时有人打电话,无论其振铃/振动设置如何)。

Is this possible? 这可能吗? Would my application have to be running all the time or can it just run during a ring? 我的应用程序是否必须一直运行,还是只能在响铃期间运行? (it is a light application, not sure how long it will take to load up though). (这是一个轻量级的应用程序,虽然不确定加载需要多长时间)。

I basically want to react to a ring, and then determine whether to ring or vibrate. 我基本上想对铃声做出反应,然后确定是响还是振动。

除非您拥有越狱的手机,否则这是不可能的。

If your application is currently running when the call comes in, you'll receive the notification UIApplicationWillResignActiveNotification indicating that the app will go offscreen and be replaced by the call screen. 如果调用时您的应用程序当前正在运行,您将收到通知UIApplicationWillResignActiveNotification,指示该应用程序将退出屏幕并由呼叫屏幕替换。

I think that's the only way you can do it without a jailbroken phone, though. 我认为,这是没有越狱电话的唯一方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM