sendMessage method

  1. @override
Future<V2TimValueCallback<V2TimMessage>> sendMessage({
  1. required String id,
  2. required String receiver,
  3. required String groupID,
  4. int priority = 0,
  5. bool onlineUserOnly = false,
  6. bool isExcludedFromUnreadCount = false,
  7. bool isExcludedFromLastMessage = false,
  8. bool? isSupportMessageExtension = false,
  9. bool? isExcludedFromContentModeration = false,
  10. bool needReadReceipt = false,
  11. Map<String, dynamic>? offlinePushInfo,
  12. String? cloudCustomData,
  13. String? localCustomData,
})
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,
}) async {
  return V2TimValueCallback<V2TimMessage>.fromJson(
    formatJson(
      await _channel.invokeMethod(
        "sendMessage",
        buildMessageMangerParam(
          {
            "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,
          },
        ),
      ),
    ),
  );
}