Swift: Quickblox 跟踪启动调用并出现错误(调试)

Swift: Quickblox trace startcall and get error ( debuging )

我使用下面的代码:

var sendQb = "XXX"
var sendRoom = "YYY"

var w = QBRTCConferenceType.video

let newSession = QBRTCClient.instance().createNewSession(withOpponents: [NSNumber.init(value: sendQb)], with: w)
var sendUser = [String: String]()
sendUser["room"] = "\(sendRoom)"

self.session = newSession
self.session?.startCall(sendUser)

此代码有时有效,有时无效!

如何在 startCall() 之后跟踪呼叫?

我想在接受之前从 quickblox 获取调用结果。喜欢:

1- 用户是否连接到 quickblox?

2- 用户是否连接到另一个用户?

3- quickblox 是否连接到用户?

还有更多

Quickblox 委托方法 (swift 4)

您可以使用 Quickblox 委托方法来完成

func session(_ session: QBRTCBaseSession, connectedToUser userID: NSNumber) {
    // Called when connection is established with user.
}

func session(_ session: QBRTCSession, hungUpByUser userID: NSNumber, userInfo: [String : String]? = nil) { 
    // Called when user hung up.
}

func session(_ session: QBRTCSession, userDidNotRespond userID: NSNumber) {
    // Called in case when user did not respond to your call within timeout.
    //default value: 45 seconds
}

func session(_ session: QBRTCSession, acceptedByUser userID: NSNumber, userInfo: [String : String]? = nil) {
    // Called when user hung up.
}

func session(_ session: QBRTCSession, rejectedByUser userID: NSNumber, userInfo: [String : String]? = nil) {
    // Called in case when user rejected you call.
}

func session(_ session: QBRTCBaseSession, receivedRemoteVideoTrack videoTrack: QBRTCVideoTrack, fromUser userID: NSNumber) {
    // Called when receivedRemoteVideoTrack
}

func sessionDidClose(_ session: QBRTCSession) {
    // Called when session is closed.
}

func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil) {
    // Called when someone started a new session with you.
}