sendImageMessage method

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

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

Implementation

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