来电唤醒iOS后台App?
当有来电时,是否可以在后台唤醒应用程序,并访问 CoreTelephony 以通过网络发送一些信息?
我现在在 iOS 开发方面几乎是个新手,但有人问我一个问题,iOS 是否能够做到这一点。我也在 iOS 参考中进行了搜索,但没有成功。
如果有比较有经验的人能够解答一下就好了。多谢!
速记
is it possible to wake an App in the background up, when a call comes in, and access CoreTelephony to send some infos over the web?
I'm practically a n00b in iOS development right now, but got asked a question if iOS is capable to do this. I searched in the iOS reference too, but with no luck.
It would be great if someone with more experience could answer it. Thanks a lot!
Steno
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请查看有关 执行的文档后台代码。
如果您转到“实现 VoIP 应用程序”部分,您会发现您的应用程序实际上可以定期被唤醒,以便它可以检查它是否有任何事情要做(在您的情况下,如果我理解正确的话,您会使用
CTCall
检查呼叫状态)。因此,基本上,当唤醒时,您的应用程序可以检查任何来电,然后使用核心电话,正如您所说。
唯一的麻烦是,如果你的应用程序不能被视为 VOIP 应用程序,Apple 不会让它进入 App Store。
Please, have a look at the document about executing code in the background.
If you go to section "Implementing a VoIP Application", you will see that it is actually possible for your app to be awaken periodically so that it can check if it has anything to do (in your case, if I understand you correctly you would use
CTCall
to check for calling state).So, basically, when awaken, your app could check for any incoming call and then use Core Telephony, as you say.
The only trouble about this is that if your app cannot be considered to a a VOIP app, Apple will not let it into the App Store.
收到呼叫时无法运行您的代码。
It is not possible to have your code run when a call is received.