sendEventMessage static method
Future<SendMessageResult>
sendEventMessage(
- String tid,
- String type,
- String content,
- LVPushContent? lvPushContent,
发送事件消息
@param tid 接收者ID @param type 消息的自定义扩展类型,可作为消息标识,但不能传空或者空串。 @param content 消息内容 SendMessageResult的字段eCode返回0为成功,其它为错误码
Implementation
static Future<SendMessageResult> sendEventMessage(String tid, String type, String content, LVPushContent? lvPushContent) async {
Map map = await _channel.invokeMethod("sendEventMessage", {
"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);
// if(!type.startsWith(TYPE_MESSAGE_EVENT)){
// return null;
// }
// print("type = "+type);
// return await sendPrivateMessage(MessageSubType.IM_SUBTYPE_TEXT, tid, type, content);
}