reSendMessage method

Future reSendMessage(
  1. Map<String, dynamic> params
)

Implementation

Future<dynamic> reSendMessage(Map<String, dynamic> params) async {
  try {
    final res = await wrappedPromiseToFuture(timeweb!.reSendMessage(parse(params['webMessageInstance'])));
    final code = res.code;
    if (code == 0) {
      final message = jsToMap(res.data)['message'];
      final formatedMessage = await V2TIMMessage.convertMessageFromWebToDart(message);
      return CommonUtils.returnSuccess<V2TimMessage>(formatedMessage);
    } else {
      return CommonUtils.returnErrorForValueCb<V2TimMessage>('重发失败!');
    }
  } catch (error) {
    return CommonUtils.returnErrorForValueCb<V2TimMessage>(error);
  }
}