Closed Maks273 closed 1 year ago
+1, I see this issue too and I'm unsure how to capture this case within the QuickBlox SDK?
Is there an in-SDK solution or will I have to develop something bespoke like a WebSocket notification between devices?
@Maks273 @djmckee Hi there! For supporting multiple devices to receive signals like accept and reject by user on both phone you need to set QBSettings.carbonsEnabled = true . After that You can use the QBRTCClientDelegate method: session( , acceptedByUser userID, userInfo) and session( , rejectedByUser userID, userInfo) to detect that signals come from another user device and stop the call. To do this, call the CallKit’s CXProvider method: reportCall(with UUID: UUID, endedAt dateEnded: Date?, reason endedReason: CXCallEndedReason) with endedReason: answerElsewhere = 4 // The call was answered from another device
//MARK: - QBRTCClientDelegate
func session(_ session: QBRTCSession, acceptedByUser userID: NSNumber, userInfo: [String : String]? = nil) {
if QBSession.current.currentUserID == userID.uintValue {
provider.reportCall(with: call.uuid, endedAt: Date(), reason: .answeredElsewhere)
}
}
func session(_ session: QBRTCSession, rejectedByUser userID: NSNumber, userInfo: [String : String]? = nil) {
if QBSession.current.currentUserID == userID.uintValue {
provider.reportCall(with: call.uuid, endedAt: Date(), reason: .answeredElsewhere)
}
}
If you are using our “sample-videochat-webrtc-swift” then you can add next to SessionsController:
//MARK: - QBRTCClientDelegate
extension SessionsController: QBRTCClientDelegate {
func session(_ session: QBRTCSession, acceptedByUser userID: NSNumber, userInfo: [String : String]? = nil) {
if QBSession.current.currentUserID == userID.uintValue {
removeSession(session.id)
}
}
func session(_ session: QBRTCSession, rejectedByUser userID: NSNumber, userInfo: [String : String]? = nil) {
if QBSession.current.currentUserID == userID.uintValue {
removeSession(session.id)
return
}
}
}
@VladimirNybozhinsky thanks, that makes sense
I have read the Documentation I have searched for a similar issue in the project and found none
I faced with an issue with iOS sdk and didn't found any solutions, unfortunately
Steps to reproduce:
BUT it's still ringing on another(2nd device) of userA
QUESTION: how to solve the issue. I didn't found any delegate's methods to handle this case. Also tried to google the same question and check issues of this repo but guys also didn't get any answer of that