CallKit阻止了PushKit的调用

时间:2018-09-19 10:46:04

标签: ios iphone callkit pushkit

我在iOS应用中使用PushKit和CallKit来发送和接收呼叫。 我的问题是,当应用程序被终止并接到电话时,会呼叫didReceiveIncomingPushWith,并使用

行显示本地电话屏幕
provider.reportNewIncomingCall(with: currentCallID, update: update, completion: { error in })

但是一旦该线路被呼叫并出现本机呼叫屏幕,则在呼叫者取消呼叫的情况下,didReceiveIncomingPushWith将不再被呼叫。

奇怪的是,如果我评论了这一行

provider.reportNewIncomingCall(with: currentCallID, update: update, completion: { error in })

didReceiveIncomingPushWith被完美地呼唤。

有人有任何解释/解决方案吗?

  

编辑

我正在使用XMPP服务器,该服务器的套接字处于打开状态,以防万一我用didReceiveIncomingPushWith方法关闭了该套接字,但是它起作用了(但是导致另一个问题,因为那里的连接丢失了,所以我无法回答)。

1 个答案:

答案 0 :(得分:0)

每当您取消呼叫/终端时,始终调用该方法并告诉系统该呼叫的状态已更改。

Objective-C

[provider reportCallWithUUID: currentCallID endedAtDate:endingDate reason:(CXCallEndedReasonDeclinedElsewhere)];

迅速

provider.reportCall(with: currentCallID, endedAt: endingDate, reason: .declinedElsewhere)