逐条消息已读功能
重要提示
逐条消息已读功能(消息已读 V5)支持对每条消息分别处理已读状态,并提供消息级别的已读明细查询能力。
发送消息时开启已读 V5
如需支持 V5 已读回执,发送前需将消息对象的 needReceipt 设置为 true。
示例代码
提示
以下示例中,engine 是已初始化的 RCIMIWEngine 实例。关于如何初始化 SDK,请参考初始化文档。
Dart
final RCIMIWTextMessage? message = await engine.createTextMessage(
RCIMIWConversationType.private,
"targetId",
null,
"hello",
);
message?.needReceipt = true;
await engine.sendMessage(
message!,
callback: RCIMIWSendMessageCallback(
onMessageSaved: (msg) {},
onMessageSent: (code, msg) {},
),
);
消息对象新增属性
| 参数 | 类型 | 说明 |
|---|---|---|
needReceipt | bool | 是否支持发送已读回执(发送前配置) |
sentReceipt | bool | 是否已发送已读回执(SDK 内部维护) |