VOIP通话断开后如何关闭Callkit屏幕 [英] How to close Callkit screen after VOIP call disconnected

查看:427
本文介绍了VOIP通话断开后如何关闭Callkit屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦我的voip呼叫被源或目的地断开,我将尝试删除Callkit屏幕.

I am trying to remove callkit screen once my voip call is disconnected by source or destination.

我使用了此代码

CXEndCallAction *endaction = [[CXEndCallAction alloc] initWithCallUUID:[NSUUID UUID]];
CXCallController *callController = [[CXCallController alloc] initWithQueue:dispatch_get_main_queue()];
requestTransaction:[CXTransaction transactionWithActions:nil completion:completion]];

但无法关闭呼叫包.谁能帮助我解决这个问题?

But it is not working to close the callkit. Can any one help me to solve this issue?

推荐答案

您可以在呼叫断开方法上使用以下方法.

You can use this below method on call disconnected method.

@property (nonatomic, strong) CXCallController *callKitCallController;

- (void)performEndCallActionWithUUID:(NSUUID *)uuid {
    if (uuid == nil) {
        return;
    }

    CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:uuid];
    CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endCallAction];

    [self.callKitCallController requestTransaction:transaction completion:^(NSError *error) {
        if (error) {
            NSLog(@"EndCallAction transaction request failed: %@", [error localizedDescription]);
        }
        else {
            NSLog(@"EndCallAction transaction request successful");
        }
    }];
}

这篇关于VOIP通话断开后如何关闭Callkit屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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