createCustomMessage static method

Future<NIMResult<NIMMessage>> createCustomMessage(
  1. {required String sessionId,
  2. required NIMSessionType sessionType,
  3. String? content,
  4. NIMMessageAttachment? attachment,
  5. NIMCustomMessageConfig? config}
)

创建自定义消息

Implementation

static Future<NIMResult<NIMMessage>> createCustomMessage(
    {required String sessionId,
    required NIMSessionType sessionType,
    String? content,
    NIMMessageAttachment? attachment,
    NIMCustomMessageConfig? config}) async {
  var message = NIMMessage.customEmptyMessage(
      sessionId: sessionId,
      sessionType: sessionType,
      content: content,
      attachment: attachment,
      config: config);
  return NimCore.instance.messageService._createMessage(message: message);
}