How to close call kit when call doesn't connect but call kit ui is running in the background

爱⌒轻易说出口 提交于 2019-12-11 05:35:37

问题


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?


回答1:


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 details: HERE

EDIT

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.



来源:https://stackoverflow.com/questions/53890160/how-to-close-call-kit-when-call-doesnt-connect-but-call-kit-ui-is-running-in-th

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!