getChannelAttributesByKeys method

Future<List<AgoraRtmChannelAttribute>> getChannelAttributesByKeys(
  1. String channelId,
  2. List<String> keys
)

Gets the attributes of a specified channel using attribute keys.

Implementation

Future<List<AgoraRtmChannelAttribute>> getChannelAttributesByKeys(
    String channelId, List<String> keys) async {
  final res = await _callNative(
      "getChannelAttributesByKeys", {'channelId': channelId, 'keys': keys});
  if (res["errorCode"] != 0)
    throw AgoraRtmClientException(
        "getChannelAttributesByKeys failed errorCode:${res['errorCode']}",
        res['errorCode']);
  return List<Map<dynamic, dynamic>>.from(res["attributes"])
      .map((attr) => AgoraRtmChannelAttribute.fromJson(attr))
      .toList();
}