Learn how to connect to the chat server and set connection settings.
Connection Event | Description |
---|---|
QB.chat.EVENT_TYPE.CONNECTED | Fired when the connection to the QuickBlox server is established successfully. |
QB.chat.EVENT_TYPE.CONNECTION_CLOSED | Fired when the connection to the QuickBlox server is closed normally, typically by calling the disconnect method. |
QB.chat.EVENT_TYPE.CONNECTION_CLOSED_ON_ERROR | Fired when the connection to the QuickBlox server is closed due to an error. |
QB.chat.EVENT_TYPE.RECONNECTION_FAILED | Fired when the reconnection attempt to the QuickBlox server fails. |
QB.chat.EVENT_TYPE.RECONNECTION_SUCCESSFUL | Fired when the reconnection attempt to the QuickBlox server is successful. |
disconnect()
method when an app goes to the background and connect()
method when an app goes to the foreground. As a result, the SDK will disconnect/connect the current user from the Chat server when the app goes to the background/foreground mode.