connect

fun SendbirdChat.connect(userId: String, authToken: String? = null, apiHost: String? = null, wsHost: String? = null, handler: ConnectResultHandler?)

Connects to SendbirdChat with given User ID and auth token. If you have created Users without auth token, pass authToken with null.

Since

4.15.0

Parameters

userId

User ID to connect with. Refer to User.userId.

authToken

Auth token. It should not be saved on the client side.

apiHost

Custom API Host. Internal use only.

wsHost

Custom WS Host. Internal use only.

handler

Callback handler.


suspend fun SendbirdChat.connect(userId: String, authToken: String? = null, apiHost: String? = null, wsHost: String? = null): AuthUser

Deprecated

As of 4.17.0, replaced with awaitConnect(userId, authToken, apiHost, wsHost).

Replace with

awaitConnect(userId, authToken, apiHost, wsHost)

Connects to SendbirdChat with given User ID and auth token. If you have created Users without auth token, pass authToken with null.

Return

The AuthUser object of the current user and the socket connection state.

Since

4.15.0

Parameters

userId

User ID to connect with. Refer to User.userId.

authToken

Auth token. It should not be saved on the client side.

apiHost

Custom API Host. Internal use only.

wsHost

Custom WS Host. Internal use only.