我正在使用callkit for voip app,On Every Fresh install,CallKit startCallAction请求失败并抛出“com.apple.CallKit.error.requesttransaction error 7”。
请找到下面负责的方法。
func performStartCallAction(handle: String) {
let uuid = UUID()
let callHandle = CXHandle(type: .phoneNumber, value: handle)
let startCallAction = CXStartCallAction(call: uuid, handle: callHandle)
let startCallTransaction = CXTransaction(action: startCallAction)
callKitController.request(startCallTransaction) { error in
if let error = error {
print("StartCallAction transaction request failed: \(error.localizedDescription)")
return
}
let callUpdate = CXCallUpdate()
callUpdate.remoteHandle = callHandle
callUpdate.supportsDTMF = true
callUpdate.supportsHolding = true
callUpdate.supportsGrouping = false
callUpdate.supportsUngrouping = false
callUpdate.hasVideo = false
self.callKitProvider.reportCall(with: uuid, updated: callUpdate)
}
}
在后续运行中,相同的代码可以正常工作。
我不确定我做错了什么,请帮忙。 TIA。