sendRoomMessage static method

Future<SendMessageResult> sendRoomMessage(
  1. String targetId,
  2. String msgContent,
  3. String msgType
)

发送房间消息

@param targetId 房间Id @param msgContent 消息内容 @param msgType 消息的自定义扩展类型 @param listener 发送结果监听 SendMessageResult的字段eCode返回0为成功,其它为错误码

Implementation

static Future<SendMessageResult> sendRoomMessage(String targetId, String msgContent, String msgType) async {
  if(msgType == null || msgType == ""){
    // 随便给个值,以免检查msgTye报错。
    msgType = "msgType";
  }
  Map map = await _channel.invokeMethod("sendRoomMessage", {
    "targetId": targetId,
    "msgContent": msgContent,
    "msgType": msgType,
  });
  // 将Msg字段的值转成LVIMMsg对象返回
  return SendMessageResult.convertFromMap(map);
}