addAllowList method

Future<void> addAllowList(
  1. String groupId,
  2. List<String> members
)

~english Adds members to the group allowlist. Only the group owner and admins can call this method.

Param groupId The group ID. Param members The list of members to be added to the allowlist.

Returns None.

Throws Exception description, see EMError. ~end

~chinese 添加群成员到白名单。 仅群主和管理员有权限调用。

Param groupId 群组 ID。 Param members 要添加到白名单的成员列表。

Return 无。

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

Implementation

Future<void> addAllowList(
  String groupId,
  List<String> members,
) async {
  try {
    Map req = {'groupId': groupId, 'members': members};
    Map result = await Client.instance.groupManager
        .callNativeMethod(ChatMethodKeys.addWhiteList, req);
    EMError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}