setMessageExtensions method

  1. @override
Future<V2TimValueCallback<List<V2TimMessageExtensionResult>>> setMessageExtensions({
  1. required String msgID,
  2. required List<V2TimMessageExtension> extensions,
})
override

Implementation

@override
Future<V2TimValueCallback<List<V2TimMessageExtensionResult>>> setMessageExtensions({
  required String msgID,
  required List<V2TimMessageExtension> extensions,
}) async {
  Map<String, dynamic> param = {
    "msgID": msgID,
    "extensions": extensions
        .map(
          (e) => Map.from(
            {
              "key": e.extensionKey,
              "value": e.extensionValue,
            },
          ),
        )
        .toList(),
  };
  var resp = V2TimValueCallback<List<V2TimMessageExtensionResult>>.fromJson(
    formatJson(
      await _channel.invokeMethod(
        "setMessageExtensions",
        buildMessageMangerParam(
          param,
        ),
      ),
    ),
  );
  log("setMessageExtensions", param, resp.toLogString());
  return resp;
}