sendTextMessageWithMessageAck static method
发送文本消息 自动设置是否需要已读回执
Implementation
static Future<NIMResult<NIMMessage>> sendTextMessageWithMessageAck(
{required String sessionId,
required NIMSessionType sessionType,
required String text}) async {
var msgBuilder = await MessageBuilder.createTextMessage(
sessionId: sessionId, sessionType: sessionType, text: text);
if (msgBuilder.isSuccess && msgBuilder.data != null) {
msgBuilder.data!.messageAck = await ConfigRepo.getShowReadStatus();
return sendMessage(message: msgBuilder.data!);
} else {
return NIMResult.failure(message: msgBuilder.errorDetails);
}
}