1

I am working in one of the video calling Project in SWIFT language with Quickblox sdk.i am trying to make call with another user with its quickbloxid. but when i start call from one of the device to another device. the didReceiveNewSession delegate method is not getting called on another device and the log appears with error message of service not available. please let me know where i ma doing mistake. thanks in Advance.

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")
    }
aman
  • 15
  • 6

2 Answers2

1
  • Did you connected to the chat?
  • Also did you call QBRTCClient.initializeRTC()?
VitGur
  • 539
  • 9
  • 13
  • yes i had Connected it to QBChat as well initializeRTC.. After a littile research i found the problem is When i start call from other device. – aman May 05 '16 at 04:45
  • @aman Please create issue on [github](https://github.com/QuickBlox/quickblox-ios-sdk) and attach there your sample with reproducible bug – VitGur May 05 '16 at 11:50
  • 1
    Hey, I have added QBRTCClient.initializeRTC() in my Swift project but still this method is not called in my app what could be the issue. This crashes with below reason : [__NSCFConstantString count]: unrecognized selector sent to instance ios – Pradumna Patil Mar 14 '18 at 10:19
  • @PradumnaPatil Yeah, even I am facing the same issue. How did you resolved it? – Saurabh Aug 02 '21 at 13:12
1

Please try this code

you need to add chat delegate also on first after qbrtcclient delegate need to add I have same issue solved after this step .

        QBChat.instance.addDelegate(self)
        QBRTCClient.instance().add(self)
Hardik Bar
  • 1,660
  • 18
  • 27