Swift:Quickblox 跟踪启动调用并获取错误(调试)

Posted

技术标签:

【中文标题】Swift:Quickblox 跟踪启动调用并获取错误(调试)【英文标题】:Swift: Quickblox trace startcall and get error ( debuging ) 【发布时间】:2018-09-08 10:31:02 【问题描述】:

我使用下面的代码:

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 是否连接到用户?

还有更多

【问题讨论】:

【参考方案1】:

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.

【讨论】:

以上是关于Swift:Quickblox 跟踪启动调用并获取错误(调试)的主要内容,如果未能解决你的问题,请参考以下文章

未读消息总数 quickblox

QuickBlox:没有快速调用 didReceive 会话方法

如何在 quickblox (Swift, iOS, xcode) 中实现发送图片

Quickblox + Swift 3.0 iOS SDK 错误:未找到应用程序和 QBConnectionZoneTypeProduction

iOS swift quickblox 集成

如何使用 phonegap + quickblox 注册/登录用户?