Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Every outgoing call become Canceled Call. #265

Closed
ryojiro opened this issue Apr 2, 2023 · 2 comments
Closed

iOS: Every outgoing call become Canceled Call. #265

ryojiro opened this issue Apr 2, 2023 · 2 comments

Comments

@ryojiro
Copy link
Contributor

ryojiro commented Apr 2, 2023

This code is called when outgoing call for CallKit.

public func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
let call = Call(uuid: action.callUUID, data: self.data!, isOutGoing: true)
call.handle = action.handle.value
configurAudioSession()
call.hasStartedConnectDidChange = { [weak self] in
self?.sharedProvider?.reportOutgoingCall(with: call.uuid, startedConnectingAt: call.connectData)
}
call.hasConnectDidChange = { [weak self] in
self?.sharedProvider?.reportOutgoingCall(with: call.uuid, startedConnectingAt: call.connectedData)
}
self.outgoingCall = call;
self.callManager?.addCall(call)
self.sendEvent(SwiftFlutterCallkitIncomingPlugin.ACTION_CALL_START, self.data?.toJSON())
action.fulfill()
}

Especially, these lines are called on outgoing call when a callee answered.

call.hasConnectDidChange = { [weak self] in
self?.sharedProvider?.reportOutgoingCall(with: call.uuid, startedConnectingAt: call.connectedData)
}

However, I think this API is wrong by Apple Documentation. https://developer.apple.com/documentation/callkit/cxprovider/1930695-reportoutgoingcall

This part fixes at #264

Also, this method hasConnected should be called when callee answered.

var hasConnected: Bool {
get{
return connectedData != nil
}
set{
connectedData = newValue ? Date() : nil
}
}

However this method is never called in this time. I tried to fix this part but I don't have enough knowledge for Swift so I couldn't.

@hiennguyen92
Copy link
Owner

Please update to version 2.0.0 (make sure you check the changelog, because the input structure has been changed)
await FlutterCallkitIncoming.setCallConnected(this._currentUuid);

@ryojiro
Copy link
Contributor Author

ryojiro commented May 13, 2023

Thank you so much !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants