Skip to main content

Join a specified chatroom. The chatroom must be created before joining; during integration, use API debugging in the Admin Console > Application > Developer Tools.

After joining, the SDK automatically synchronizes the latest 50 messages and all attribute information in the room locally, then returns them to the business layer through the chatroom listener.

Multi-device sign-in:

Scenario 1: One user can join multiple chatrooms on one device. Messages are isolated and returned through the message listener.

Scenario 2: One user can join multiple chatrooms from multiple devices, such as Web and iOS. Sent and received messages synchronize automatically across devices.

Example

//the join result is delivered through the chatroom listener callback
String chatroomId = "chatroomId1";
int count = 10;
JIM.getInstance().getChatroomManager().joinChatroom(chatroomId, count);