iOS-我可以在使用Callkit接听电话时打开VoIP应用程序吗? [英] iOS - Can I open my VoIP app on answering call using Callkit?

查看:158
本文介绍了iOS-我可以在使用Callkit接听电话时打开VoIP应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正计划创建一个iOS VoIP应用程序(之前没有做过任何iOS应用程序).我在IOS上读到有关 Callkit 的信息,通过它我的应用程序可以使他的应用通过iPhone本机呼叫屏幕接收电话.

I'm planning to create an iOS VoIP app(not made any iOS app before). I was reading about Callkit in IOS by which one can make his app receive phone call through iPhone native call screen.

我在在此处阅读了 Callkit API 提到可以知道是否接听电话.

I read Callkit api here where it is mentioned that one can know if a call is answered.

通过教程和这是检测呼叫已应答的代码:

Going through this tutorial and here is the code which detects the call is answered:

-(void)reportIncomingCallWithHandle:(NSString *)handle
                            success:(void (^)())success
                            failure:(void (^)(NSError * error))failure {
    CXCallUpdate *update = [self newCallUpdateWithHandle:handle];
    self.callId = [NSUUID UUID];

    [self.provider reportNewIncomingCallWithUUID:self.callId update:update completion:^(NSError * _Nullable error) {
        if (error) {
            if (failure) failure(error);
        } else {
            if (success) {
                success();
            }
        }
    }];
}

请参阅成功框.那么,执行此成功块时,有没有办法打开我的应用程序?还是可以覆盖呼叫者屏幕上的默认按钮以打开我的应用?

See the success block. So is there is a way to open my app when this success block executed? Or can I override default buttons on caller screen to open my app?

我知道在收到任​​何类型的通知或事件触发器时无法打开应用程序.因此,如果我可以使用 Callkit

I know there is no way to open an app on receiving any kind of notification, or event trigger. So thought may be there is some way if I can do the same using Callkit

我用Google搜索了所有内容,但没有发现有关上述查询的任何线索.如果可能,请帮助我.

I Googled everything but found no clue regarding my above queries. Please help me if it is possible or not.

推荐答案

我遇到了相同的问题.行为取决于设备是否被锁定.

I encountered the same issue. The behavior varies depending on if the device is locked or not.

  1. 已锁定:出现系统调用屏幕.您可以在后台运行该应用程序,包括视图转换.但是,尽管您的应用程序显示在视图下方,但用户只会看到系统调用屏幕.由于设备已锁定,因此深层链接也无法正常工作.
  2. 未锁定:呼叫屏幕相同,但是一旦用户接听电话,就会显示该应用.

如您所知,我们可以在打开应用程序的呼叫屏幕上更改按钮的图标,这是到目前为止我们能做的最好的事情.

As you may know, we can change the icon of the button on the calling screen which opens the app, and that's the best we can do as of now.

这篇关于iOS-我可以在使用Callkit接听电话时打开VoIP应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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