joinExistChatRoom

public abstract void joinExistChatRoom(String chatRoomId, int defMessageCount, ResultCallback<JoinChatRoomResponse> callback)

Join an existing chatroom.

Clients must create a chatroom via the Server API before calling this method to join the chatroom.

If the chatroom does not exist, the join operation will fail. When joining a chatroom, you can specify the number of messages to retrieve.

Since

5.3.1: After joining the chatroom, if the network is disconnected and reconnected, the default number of messages retrieved is the same as the number of historical messages retrieved when actively joining. Since the number of messages passed in is fixed each time, it may result in message duplication. The app needs to handle message deduplication.

5.6.3

Parameters

chatRoomId

The ID of the chatroom.

defMessageCount

The number of messages to retrieve when entering the chatroom. -1 means no messages will be retrieved, 0 means 10 messages will be retrieved, and the maximum number of messages that can be retrieved is 50.

callback

The status callback. The information returned by the chatroom


public abstract void joinExistChatRoom(String chatRoomId, int defMessageCount, String extra, ResultCallback<JoinChatRoomResponse> callback)

Join an existing chatroom.

Clients must create a chatroom via the Server API before calling this method to join the chatroom.

If the chatroom does not exist, joining will fail. When joining the chatroom, you can specify the number of messages to fetch.

Since

5.3.1: After joining the chatroom, reconnecting to the chatroom upon network disconnection will fetch the default number of chatroom messages, which is the same as the number of historical messages fetched when actively joining. Since the number of messages fetched is fixed, this may result in message duplication. The app needs to handle message deduplication.

5.6.3

Parameters

chatRoomId

The ID of the chatroom.

defMessageCount

The number of messages to fetch when entering the chatroom. -1 means no messages will be fetched, 0 means 10 messages will be fetched, and the maximum number of messages that can be fetched is 50.

extra

Additional information, with a default maximum length of 128 characters, configurable by the service.

callback

Status callback. The information returned by the chatroom


@Deprecated()
public abstract void joinExistChatRoom(String chatRoomId, int defMessageCount, OperationCallback callback)

Deprecated

Joins an existing chatroom.

Clients must create a chatroom via the Server API before calling this method to join the chatroom.

If the chatroom does not exist, the join operation will fail. When joining the chatroom, you can specify the number of messages to pull from the chatroom.

Since

5.3.1: After joining the chatroom, if the network is disconnected and reconnected, the default number of messages fetched upon rejoining will be the same as the number of historical messages fetched during the initial join. Since the number of messages fetched is fixed, message duplication may occur, and the app needs to handle message deduplication.

Deprecated

5.6.3 Please use joinExistChatRoom

Parameters

chatRoomId

The ID of the chatroom.

defMessageCount

The number of messages to pull when entering the chatroom. -1 means no messages will be pulled, 0 means 10 messages will be pulled, and the maximum number of messages that can be pulled is 50.

callback

The status callback.