fetchBlockListFromServer method

Future<List<String>> fetchBlockListFromServer(
  1. String groupId, {
  2. int pageSize = 200,
  3. int pageNum = 1,
})

~english Gets the group blocklist from the server. Only the group owner and admins can call this method.

Param groupId The group ID. Param pageNum The page number. Param pageSize The number of results expected per page.

Returns The group blocklist.

Throws Exception description, see EMError. ~end

~chinese 获取群组黑名单列表。 仅群主和管理员有权限调用。

Param groupId 群组 ID。 Param pageNum 获取第几页。 Param pageSize 每页获取的数量。

Return 群组黑名单列表。

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

Implementation

Future<List<String>> fetchBlockListFromServer(
  String groupId, {
  int pageSize = 200,
  int pageNum = 1,
}) async {
  try {
    Map req = {'groupId': groupId, 'pageNum': pageNum, 'pageSize': pageSize};
    Map result = await Client.instance.groupManager
        .callNativeMethod(ChatMethodKeys.getGroupBlockListFromServer, req);
    EMError.hasErrorFromResult(result);
    return result[ChatMethodKeys.getGroupBlockListFromServer]
            ?.cast<String>() ??
        [];
  } catch (e) {
    rethrow;
  }
}