sendReplyMessage
功能介绍
发送回复消息
参数详解
参数 |
参数类型 |
是否必填 |
含义 |
id |
String |
是 |
发送的回复消息的id |
receiver |
String |
是 |
单聊消息接收者 userID |
groupID |
String |
是 |
群聊 groupID |
replyMessage |
V2TimMessage |
是 |
被回复的消息 |
priority |
MessagePriorityEnum |
否 |
消息优先级 |
onlineUserOnly |
bool |
否 |
是否只有在线用户才能收到 |
needReadReceipt |
bool |
否 |
消息是否需要已读回执 |
offlinePushInfo |
OfflinePushInfo |
否 |
离线推送信息 |
isExcludedFromUnreadCount |
bool |
否 |
发送消息是否计入会话未读数 |
localCustomData |
String |
否 |
消息本地数据 |
返回值
V2TimValueCallback<V2TimMessage>
{
code : int
desc : String
data : {
cloudCustomData : String
customElem : V2TimCustomElem
elemType : int
faceElem : V2TimFaceElem
faceUrl : String
fileElem : V2TimFileElem
friendRemark : String
groupAtUserList : List<String>
groupID : String
groupTipsElem : V2TimGroupTipsElem
id : String
imageElem : V2TimImageElem
isExcludedFromLastMessage : bool
isExcludedFromUnreadCount : bool
isPeerRead : bool
isRead : bool
isSelf : bool
localCustomData : String
localCustomInt : int
locationElem : V2TimLocationElem
mergerElem : V2TimMergerElem
messageFromWeb : String
msgID : String
nameCard : String
needReadReceipt : bool
nickName : String
offlinePushInfo : V2TimOfflinePushInfo
priority : int
progress : int
random : int
sender : String
seq : String
soundElem : V2TimSoundElem
status : int
textElem : V2TimTextElem
timestamp : int
userID : String
videoElem : V2TimVideoElem
}
}
返回值详解
代码示例
V2TimValueCallback<V2TimMsgCreateInfoResult> createTextMessageRes =
await TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.createTextMessage(
text: "test",
);
V2TimValueCallback<List<V2TimMessage>> findMessageRes =
await TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.findMessages(messageIDList: []);
if (createTextMessageRes.code == 0) {
String? id = createTextMessageRes.data?.id;
V2TimValueCallback<V2TimMessage> sendMessageRes = await TencentImSDKPlugin
.v2TIMManager
.getMessageManager()
.sendReplyMessage(
id: id!,
receiver: "userID",
groupID: "groupID",
replyMessage: findMessageRes.data![0],
priority: MessagePriorityEnum.V2TIM_PRIORITY_DEFAULT,
onlineUserOnly:
false,
isExcludedFromUnreadCount: false,
needReadReceipt:
false,
offlinePushInfo: OfflinePushInfo(),
localCustomData:
""
);
if (sendMessageRes.code == 0) {
}
}