简体   繁体   English

iOS-我可以在使用Callkit接听电话时打开VoIP应用程序吗?

[英]iOS - Can I open my VoIP app on answering call using Callkit?

I'm planning to create an iOS VoIP app(not made any iOS app before). 我打算创建一个iOS VoIP应用程序(之前没有做过任何iOS应用程序)。 I was reading about Callkit in IOS by which one can make his app receive phone call through iPhone native call screen. 我正在阅读有关IOS中的Callkit的信息 ,通过它我可以使他的应用通过iPhone本机呼叫屏幕接收电话。

I read Callkit api here where it is mentioned that one can know if a call is answered. 在这里阅读Callkit api 其中提到可以知道是否接听了电话。

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? 还是可以覆盖呼叫者屏幕上的默认按钮以打开我的应用程序?

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 因此,如果我可以使用Callkit进行相同的操作,可能会有某种方法

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. Locked: System calling screen appears. 锁定:出现系统调用屏幕。 You can run the app in the background including view transitions. 您可以在后台运行该应用程序,包括视图转换。 However, the user will only see the system calling screen although your app is kind of presented underneath the view. 但是,尽管您的应用程序显示在视图下方,但用户只会看到系统调用屏幕。 As the device is locked, deep links does not work as well. 设备被锁定后,深层链接也无法正常工作。
  2. Unlocked: Calling screen is the same but once the user answers the call, the app will be presented. 解锁:呼叫屏幕相同,但是一旦用户接听电话,就会显示该应用程序。

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

You can not open your own VoIP app or custom UI of your App from CallKit. 您无法从CallKit打开自己的VoIP应用程序或应用程序的自定义UI。 Use can use it in a way as Whatsapp does. 使用可以像Whatsapp一样使用它。

Means you can awake your app from background without using local notification. 意味着您可以在不使用本地通知的情况下将应用从后台唤醒。 And OS will show the default incoming screen. 操作系统将显示默认的传入屏幕。 You need not to handle anything during call. 您无需在通话中处理任何事情。 CallKit is specially made for enhancing VoIP apps by receiving calls in background, by making outgoing calls, by managing Call directory and blocking of users. CallKit是专门为增强VoIP应用而设计的,它可以在后台接听电话,拨出电话,管理电话目录和阻止用户。

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

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