fetchChatRoomAttributes method

Future<Map<String, String>?> fetchChatRoomAttributes(
  1. {required String roomId,
  2. List<String>? keys}

Gets the list of custom chat room attributes based on the attribute key list.

Param roomId The chat room ID.

Param keys The key list of attributes to get. If you set it as null or leave it empty, this method retrieves all custom attributes.

Return The chat room attributes in key-value pairs.

Throws A description of the exception. See ChatError.


Future<Map<String, String>?> fetchChatRoomAttributes({
  required String roomId,
  List<String>? keys,
}) async {
  Map req = {
    "roomId": roomId,

  if (keys != null) {
    req['keys'] = keys;

  Map result = await _channel.invokeMethod(
  try {
    return result[ChatMethodKeys.fetchChatRoomAttributes]
        ?.cast<String, String>();
  } on ChatError catch (e) {
    throw e;