joinChatRoom method

Future<void> joinChatRoom(
  1. String roomId
)

~english Joins the chat room.

To exit the chat room, call leaveChatRoom.

Param roomId The ID of the chat room to join.

Throws A description of the exception. See EMError. ~end

~chinese 加入聊天室

退出聊天室,调用 leaveChatRoom.

Param roomId 要加入的聊天室ID。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError。 ~end

Implementation

Future<void> joinChatRoom(String roomId) async {
  Map result = await _channel
      .invokeMethod(ChatMethodKeys.joinChatRoom, {"roomId": roomId});
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}