authenticate

fun authenticate(userId: String, authToken: String? = null, handler: AuthenticationHandler?)

Authenticates to SendbirdChat with given User ID and auth token. This method is different from SendbirdChat.connect in that it doesn't create a websocket connection. This should be used in below cases: 1. If you want to use the interface provided by the FeedChannel only. 2. If you want to use chat interface prior to SendbirdChat.connect, i.e. SendbirdChat.getTotalUnreadMessageCount.

Since

4.17.0

Parameters

userId

User ID to authenticate with. Refer to User.userId.

authToken

Auth token. It should not be saved on the client side. Set null if not used.

handler

Callback handler.


fun authenticate(userId: String, authToken: String? = null, apiHost: String?, handler: AuthenticationHandler?)

Authenticates to SendbirdChat with given User ID and auth token. This method is different from SendbirdChat.connect in that it doesn't create a websocket connection. This should be used in below cases: 1. If you want to use the interface provided by the FeedChannel only. 2. If you want to use chat interface prior to SendbirdChat.connect, i.e. SendbirdChat.getTotalUnreadMessageCount.

Since

4.17.0

Parameters

userId

User ID to authenticate with. Refer to User.userId.

authToken

Auth token. It should not be saved on the client side. Set null if not used.

apiHost

Custom API Host. Internal use only.

handler

Callback handler.


fun authenticate(userId: String, authToken: String? = null, authTokenType: AuthTokenType = AuthTokenType.SESSION_TOKEN, handler: AuthenticationHandler?)

Authenticates to SendbirdChat with given User ID and auth token. This method is different from SendbirdChat.connect in that it doesn't create a websocket connection. This should be used in below cases: 1. If you want to use the interface provided by the FeedChannel only. 2. If you want to use chat interface prior to SendbirdChat.connect, i.e. SendbirdChat.getTotalUnreadMessageCount.

Since

4.24.0

Parameters

userId

User ID to authenticate with. Refer to User.userId.

authToken

Auth token. It should not be saved on the client side. Set null if not used.

authTokenType

Auth token type. It should be one of AuthTokenType.

handler

Callback handler.


fun authenticate(userId: String, authToken: String? = null, authTokenType: AuthTokenType = AuthTokenType.SESSION_TOKEN, apiHost: String?, handler: AuthenticationHandler?)

Authenticates to SendbirdChat with given User ID and auth token. This method is different from SendbirdChat.connect in that it doesn't create a websocket connection. This should be used in below cases: 1. If you want to use the interface provided by the FeedChannel only. 2. If you want to use chat interface prior to SendbirdChat.connect, i.e. SendbirdChat.getTotalUnreadMessageCount.

Since

4.24.0

Parameters

userId

User ID to authenticate with. Refer to User.userId.

authToken

Auth token. It should not be saved on the client side. Set null if not used.

authTokenType

Auth token type. It should be one of AuthTokenType.

apiHost

Custom API Host. Internal use only.

handler

Callback handler.