sendMessage method
Future<V2TimValueCallback<V2TimMessage> >
sendMessage({
- required String id,
- required String receiver,
- required String groupID,
- int priority = 0,
- bool onlineUserOnly = false,
- bool isExcludedFromUnreadCount = false,
- bool isExcludedFromLastMessage = false,
- bool? isSupportMessageExtension = false,
- bool? isExcludedFromContentModeration = false,
- bool needReadReceipt = false,
- Map<
String, dynamic> ? offlinePushInfo, - String? cloudCustomData,
- String? localCustomData,
- bool? isDisableCloudMessagePreHook = false,
- bool? isDisableCloudMessagePostHook = false,
override
发送消息
Implementation
@override
Future<V2TimValueCallback<V2TimMessage>> sendMessage({
required String id,
required String receiver,
required String groupID,
int priority = 0,
bool onlineUserOnly = false,
bool isExcludedFromUnreadCount = false,
bool isExcludedFromLastMessage = false,
bool? isSupportMessageExtension = false,
bool? isExcludedFromContentModeration = false,
bool needReadReceipt = false,
Map<String, dynamic>? offlinePushInfo,
// 自定义消息需要
String? cloudCustomData, // 云自定义消息字段,只能在消息发送前添加
String? localCustomData,
bool? isDisableCloudMessagePreHook = false, // 是否禁用消息发送前云端回调
bool? isDisableCloudMessagePostHook = false, // 是否禁用消息发送后云端回调
}) async {
Map<String, dynamic> param = {
"id": id,
"receiver": receiver,
"groupID": groupID,
"priority": priority,
"onlineUserOnly": onlineUserOnly,
"isExcludedFromUnreadCount": isExcludedFromUnreadCount,
"isExcludedFromLastMessage": isExcludedFromLastMessage,
"isSupportMessageExtension": isSupportMessageExtension,
"isExcludedFromContentModeration": isExcludedFromContentModeration,
"offlinePushInfo": offlinePushInfo,
"cloudCustomData": cloudCustomData,
"localCustomData": localCustomData,
"needReadReceipt": needReadReceipt,
"isDisableCloudMessagePreHook": isDisableCloudMessagePreHook,
"isDisableCloudMessagePostHook": isDisableCloudMessagePostHook,
};
var resp = V2TimValueCallback<V2TimMessage>.fromJson(
formatJson(
await _channel.invokeMethod(
"sendMessage",
buildMessageMangerParam(
param,
),
),
),
);
log("sendMessage", param, resp.toLogString());
return resp;
}