首先在我的应用程序中我注册一个手机号码之后,如果我在该通话结束后接到该手机号码的电话,我想打开该应用程序(最初应用程序未启动)或我想显示一个按钮屏幕。 这可以在iOS中使用吗?
如果可能的话,请给我一些启动这个应用程序的想法。
感谢。
答案 0 :(得分:1)
你做不到。您可以查看CTCallCenter.currentCalls
但是,如果确实有通话,这只会为您提供信息。
没有正式的API可以与手机进行互动并深入挖掘。
另请注意,如果收到来电,您的应用程序将被推送到后台并且不再是有效应用。
答案 1 :(得分:0)
完成此CoreTelephony Framework。 CTCall
类提供有关呼叫状态的信息。
extern NSString const *CTCallStateDialing;
extern NSString const *CTCallStateIncoming;
extern NSString const *CTCallStateConnected;
extern NSString const *CTCallStateDisconnected;
keep in mind that if you kill your app from the app switcher (i.e. swiping up to kill the app) then the OS will never relaunch the app regardless of push notification or background fetch. In this case the user has to manually relaunch the app once and then from that point forward the background activities will be invoked