问题
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