fetchChatRoomAnnouncement method

Future<String?> fetchChatRoomAnnouncement(
  1. String roomId
)

~english Gets the chat room announcement from the server.

Param roomId The chat room ID.

Return The chat room announcement.

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

~chinese 从服务器获取聊天室公告内容。

Param roomId 聊天室 ID。

Return 聊天室公告。

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

Implementation

Future<String?> fetchChatRoomAnnouncement(
  String roomId,
) async {
  Map req = {"roomId": roomId};
  Map result = await _channel.invokeMethod(
      ChatMethodKeys.fetchChatRoomAnnouncement, req);
  try {
    EMError.hasErrorFromResult(result);
    return result[ChatMethodKeys.fetchChatRoomAnnouncement];
  } on EMError catch (e) {
    throw e;
  }
}