quickblox-ios-sdk: Quickblox can't receive video chat

I’m trying to test whether my app can initialize a video chat between two users. I’ve been spending hours but the function didReceiveNewSession: is still not called. Both users are logged in currently with QBRequest methods and I’ve also confirmed that QuickBlox keys and secrets are correct. Two users are logged in with different logins and passwords. The simplified code is as following:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        QBSettings.setApplicationID(K.quickbloxAppID)
        QBSettings.setAuthKey(K.quickbloxAuthKey)
        QBSettings.setAuthSecret(K.quickbloxAuthSecret)
        QBSettings.setAccountKey(K.quickbloxAccountKey)
        
        QBRTCClient.initializeRTC()
        return true
    }

ViewController:

    class ViewController: UIViewController, QBRTCClientDelegate {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        QBRequest.logIn(withUserEmail: "login", password: "password", successBlock: { (res, us) in
            print((us?.login)! + " logged in")
        }, errorBlock: nil)
        
        
        QBRTCClient.instance().add(self)
        
        
    }
    

    
    @IBAction func callClicked(_ sender: Any) {
        let IDs: [NSNumber] = [NSNumber(value: 24875869)]
        
        let user = QBUUser()
        user.login = "login"
        user.password = "password"
        user.id = (QBSession.current().currentUser?.id)!
        
        QBChat.instance().connect(with: user) { (err) in
            if err != nil {
                print("ERROR") // No error here
                print(err.debugDescription)
            }
            let newSession = QBRTCClient.instance().createNewSession(withOpponents: IDs, with: QBRTCConferenceType.video)
            let userInfo :[String:String] = ["key":"value"]
            newSession.startCall(userInfo)
            
        }
        
    }
    
    func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil) {
        print("Session Received")
    }
    
    }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19

Most upvoted comments

Hi,

As I see you are connecting to chat only when clicking call button. In order to receive call you should also be connected to the chat. If that is not the case, please provide full logs.