如何识别Iphone来电和显示通知? [英] how to identifying Iphone incoming call and display notification?

查看:285
本文介绍了如何识别Iphone来电和显示通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建应用程序,例如在iphone中识别来电并检查我们数据库中的来电号码。然后想要显示存储在数据库中的特定号码的通知。这些所有功能都希望在用户接听电话时运行。

i need to create application like identify incoming call in iphone and check that incoming call number in our database. then want to display notification what information stored in database for that particular number. These all functions want run when user receiving call.

这可能吗?

推荐答案

您可能希望在中开始搜索CoreTelephony 。话虽如此,如果有来电,iOS的呼叫处理事件将接管您的应用。换句话说,您的应用将在呼叫进入时暂停,并在呼叫完成后移回前台。您可以使用CoreTelephony访问CTCallCenter,其中包含一系列CTCall(正在进行调用)。据我所知,CTCall不包含电话号码。此外,您无法阻止iOS后台处理您的应用以处理呼叫。

You probably want to start your search in CoreTelephony. That being said, if a call comes in, iOS's call-handling events will take over your app. In other words, your app will be suspended when the call comes in, and move back to the foreground when the call is complete. You can use CoreTelephony to get access to the CTCallCenter, which contains an array of CTCalls (calls in progress). CTCall does not contain the phone number for the call, to my knowledge though. Furthermore, you can't stop iOS from backgrounding your app to handle the call.

这篇关于如何识别Iphone来电和显示通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆