Learn how to connect to the chat server and set connection settings.
login
method accepts a user
argument with the following fields:
Fields | Required | Description |
---|---|---|
id | yes | The ID of a user. |
token | yes | Specifies an active QuickBlox user session token set as a password. |
androidx.lifecycle.LifecycleObserver
to determine when the application goes background.
androidx.lifecycle.ProcessLifecycleOwner()
to process lifecycle changes within your app.
Parameters | Description |
---|---|
setSocketTimeout | Chat socket read timeout in seconds. Default: 60. |
setUseTls | TLS security mode used when making the connection. Default: true . |
setKeepAlive | Keep-alive option for a socket connection. Keep-alive is the option allowing to detect a stale connection. Default: true. |
setAutojoinEnabled | Automatically join dialogs loaded or created on the server. Default: false. |
setAutoMarkDelivered | Automatically mark the received messages as delivered. Default: true . |
setAllowListenNetwork | Allow SDK to listen to changes of network states. Default: true. |
setPort | Chat connection port number. Default: 5223. |