fetchAnnouncementFromServer method

Future<String?> fetchAnnouncementFromServer(
  1. String groupId
)

~english Gets the group announcement from the server.

Group members can call this method.

Param groupId The group ID.

Return The group announcement.

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

~chinese 从服务器获取群组公告。

群成员可调用此方法。

Param groupId 群组 ID。

Return 群组公告。

Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 EMError。 ~end

Implementation

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