sendPrivateMessage static method

Future<SendMessageResult> sendPrivateMessage(
  1. int messageType,
  2. String tid,
  3. String type,
  4. String content,
  5. LVPushContent? lvPushContent,
)

发送私信消息

@param sub 媒体类型 @param tid 接收者ID @param type 消息的自定义扩展类型,可作为消息标识,但不能传空或者空串。 @param content 消息内容 SendMessageResult的字段eCode返回0为成功,其它为错误码

Implementation

static Future<SendMessageResult> sendPrivateMessage(
    int messageType, String tid, String type, String content, LVPushContent? lvPushContent) async {
  Map map = await _channel.invokeMethod("sendPrivateMessage", {
    "sub": messageType,
    "tid": tid,
    "type": type,
    "content": content,
    "pushTitle": lvPushContent?.title,
    "pushBody": lvPushContent?.body,
    "pushExtra": lvPushContent?.extra,
    "pushClickAction": lvPushContent?.click_action
  });
  // 将Msg字段的值转成LVIMMsg对象返回
  return SendMessageResult.convertFromMap(map);
}