QuickBlox:didReceiveNewSession 方法未在 swift 中调用 gettimg

问题描述 投票:0回答:2

我正在使用 Quickblox sdk 参与 SWIFT 语言的视频通话项目之一。我正在尝试使用其 Quickbloxy 与另一位用户进行通话。但是当我开始从一个设备呼叫另一台设备时。 didReceiveNewSession 委托方法未在另一台设备上被调用,并且日志中显示服务不可用的错误消息。请让我知道我在哪里做错了。 预先感谢。

QBRTCClient.instance().addDelegate(self) 

func didReceiveNewSession(session: QBRTCSession!, userInfo: Dictionary<NSObject, AnyObject>!)
    {
        print("received call")

    }

func session(session: QBRTCSession!, connectedToUser userID: NSNumber!) {
         AppSingletonObj.showAlert("", messsage: "connectedToUser Delegate caled")
    }

    func session(session: QBRTCSession!, disconnectedByTimeoutFromUser userID: NSNumber!) {
          AppSingletonObj.showAlert("", messsage: "disconnectedByTimeoutFromUser Delegate caled")
    }

    func session(session: QBRTCSession!, hungUpByUser userID: NSNumber!, userInfo: [NSObject : AnyObject]!) {
        AppSingletonObj.showAlert("", messsage: "hungUpByUser Delegate caled")
    }


    func session(session: QBRTCSession!, initializedLocalMediaStream mediaStream: QBRTCMediaStream!) {
          mediaStream.videoTrack.videoCapture = self.cameraCapture
        AppSingletonObj.showAlert("", messsage: "initializedLocalMediaStream Delegate caled")
    }


    func session(session: QBRTCSession!, rejectedByUser userID: NSNumber!, userInfo: [NSObject : AnyObject]!) {
        AppSingletonObj.showAlert("", messsage: "rejectedByUser Delegate caled")
    }

    func session(session: QBRTCSession!, startedConnectingToUser userID: NSNumber!) {
         AppSingletonObj.showAlert("", messsage: "startedConnectingToUser Delegate caled")
    }

    func session(session: QBRTCSession!, userDidNotRespond userID: NSNumber!) {
        AppSingletonObj.showAlert("", messsage: "userDidNotRespond Delegate caled")
    }

    func session(session: QBRTCSession!, connectionClosedForUser userID: NSNumber!) {
        AppSingletonObj.showAlert("", messsage: "connectionClosedForUser Delegate caled")
    }

    func session(session: QBRTCSession!, disconnectedFromUser userID: NSNumber!) {
        AppSingletonObj.showAlert("", messsage: "disconnectedFromUser Delegate caled")
    }


    func session(session: QBRTCSession!, updatedStatsReport report: QBRTCStatsReport!, forUserID userID: NSNumber!) {
        AppSingletonObj.showAlert("", messsage: "updatedStatsReport Delegate caled")
    }

    func session(session: QBRTCSession!, receivedRemoteVideoTrack videoTrack: QBRTCVideoTrack!, fromUser userID: NSNumber!) {
          AppSingletonObj.showAlert("", messsage: "receivedRemoteVideoTrack Delegate caled")
    }

    func session(session: QBRTCSession!, connectionFailedForUser userID: NSNumber!) {
        AppSingletonObj.showAlert("", messsage: "connectionFailedForUser Delegate caled")
    }

    func session(session: QBRTCSession!, acceptedByUser userID: NSNumber!, userInfo: [NSObject : AnyObject]!) {
        AppSingletonObj.showAlert("", messsage: "acceptedByUser Delegate caled")
    }
ios iphone swift quickblox quickblox-android
2个回答
1
投票
  • 你连接聊天了吗?
  • 你也打过电话吗 QBRTCClient.initializeRTC()?

1
投票

请尝试此代码

在 qbrtcclient 委托需要添加之后,您还需要首先添加聊天委托,我在此步骤后解决了相同的问题。

        QBChat.instance.addDelegate(self)
        QBRTCClient.instance().add(self)
© www.soinside.com 2019 - 2024. All rights reserved.