0
iOS CallKitのマニュアルを読んだことがあります。以下のコードは、「発信通話を発信する」セクションでAppleによって提供されたコードです。機能を試してみるとstartOutGoingCall()何も起こらない、つまり発信通話のUIは表示されません。iOS Callkitを使用して発信通話をシミュレートする方法
誰かがネイティブ発信呼び出しUIをどのようにトリガーできるか教えてください。
func startOutGoingCall(){
let uuid = UUID()
let handle = CXHandle(type: .emailAddress, value: "[email protected]")
let startCallAction = CXStartCallAction(call: uuid)
startCallAction.destination = handle
let transaction = CXTransaction(action: startCallAction)
callController.request(transaction) { error in
if let error = error {
print("Error requesting transaction: \(error)")
} else {
print("Requested transaction successfully")
}
}
}
EDIT: あなたがCallKitから入手全く出UIはありません私のコードから
func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
logMessage(messageText: "provider:performStartCallAction:")
/*
* Configure the audio session, but do not start call audio here, since it must be done once
* the audio session has been activated by the system after having its priority elevated.
*/
localMedia?.audioController.configureAudioSession(.videoChatSpeaker)
callKitProvider.reportOutgoingCall(with: action.callUUID, startedConnectingAt: nil)
performRoomConnect(uuid: action.callUUID, roomName: action.handle.value) { (success) in
if (success) {
provider.reportOutgoingCall(with: action.callUUID, connectedAt: Date())
action.fulfill()
} else {
action.fail()
}
}
}