如何在呼叫未连接但呼叫套件 ui 在后台运行时关闭呼叫套件 [英] How to close call kit when call doesn't connect but call kit ui is running in the background

查看:44
本文介绍了如何在呼叫未连接但呼叫套件 ui 在后台运行时关闭呼叫套件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多次发生这样的情况,当呼叫开始时它没有连接,我无法弄清楚它在哪里卡住了.当它发生时,callkit ui 已经启动,因为我可以看到绿色的通知栏.在这种情况下,当呼叫尚未连接但 callKit ui 在后台运行时,如何关闭 callkit ui?

It happens many times that when call is started it doesn't connect and I can't figure out where it is getting stuck. When it happens the callkit ui is already started as I can see that green notification bar. How do I close callkit ui in this case when call hasn't been connected but callKit ui is running in the background?

推荐答案

如果在连接之前调用已经被远程端结束,您需要将结束的调用报告给 CXProvider 对象.

If call has ended by the remote side prior to connecting, you need to report the ended call to CXProvider object.

provider.reportCall(with: callUUID, endedAt: Date(), reason: .remoteEnded)

API 详细信息:此处

编辑

这是一个如何在无人接听时报告结束通话的示例:

Here is an example how to report end the call if there is no answer:

provider.reportCall(with: callUUID, endedAt: Date(), reason: .unanswered)

当然,您需要实现一些计时器,它会在经过一段时间后调用它而没有连接.

Of course, you need to implement some timer which will call this in case some time had passed and the call hadn't been connected.

这篇关于如何在呼叫未连接但呼叫套件 ui 在后台运行时关闭呼叫套件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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