Search code examples
iosswiftopentoktokbox

Tokbox session is not connecting in IOS


When user login in the application I am connecting the Tokbox session which is successfully working. But if logout now and disconnect the session and login again then tokbox session is not getting connected. Following error is coming

The operation couldn’t be completed. (OTSessionErrorDomain error 1006.)

I have checked the session and token and they are valid.


Solution

  • The issue is with the disconnect of TokBox session. use this to disconnect from the TokBox:-

    session!.disconnect(&error)
    if error != nil {
            print("Session Error while Disconnecting session: \(error!.localizedDescription)")
    } else{
            print("disconnectFromSession: Session disconnection request sent")
    
    }