sendFileMessage method

Future<NIMResult<NIMMessage>> sendFileMessage(
  1. {required String sessionId,
  2. required NIMSessionType sessionType,
  3. required String filePath,
  4. String? base64,
  5. int? fileSize,
  6. required String displayName,
  7. NIMNosScene nosScene = NIMNosScenes.defaultIm,
  8. MessageAction? action}
)

发送文件消息 base64 字段为web端专用,web端filePath 可传空字符串

Implementation

Future<NIMResult<NIMMessage>> sendFileMessage({
  required String sessionId,
  required NIMSessionType sessionType,
  required String filePath,
  String? base64,
  int? fileSize,
  required String displayName,
  NIMNosScene nosScene = NIMNosScenes.defaultIm,
  MessageAction? action,
}) async {
  var message = NIMMessage.fileEmptyMessage(
      sessionId: sessionId,
      sessionType: sessionType,
      filePath: filePath,
      base64: base64,
      fileSize: fileSize,
      displayName: displayName,
      nosScene: nosScene);
  return _createMessageAndSend(message, action);
}