公告:融云新文档中心已上线,欢迎到新文档中心阅读 Android IMLib 和 Android IMKit 的文档。
会话草稿
更新时间:2024-02-06
PDF
会话草稿
保存草稿
- 保存一条草稿内容至指定会话。
- 保存草稿会更新会话
sentTime
,该会话会排在列表前部。
ConversationType conversationType = ConversationType.PRIVATE;
String targetId = " 会话 Id ";
String content = "草稿内容";
RongIMClient.getInstance().saveTextMessageDraft(conversationType, targetId, content, new
ResultCallback<Boolean>() {
@Override
public void onSuccess(Boolean success) {
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
}
})
已复制
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
参数 | 类型 | 说明 |
---|---|---|
conversationType | ConversationType | 会话类型 |
targetId | String | 会话 Id |
content | String | 草稿的文字内容 |
callback | ResultCallback<Boolean> | 回调接口 |
获取草稿
获取草稿内容。
ConversationType conversationType = ConversationType.PRIVATE;
String targetId = " 会话 Id ";
RongIMClient.getInstance().getTextMessageDraft(conversationType, targetId, new
ResultCallback<String>() {
@Override
public void onSuccess(String draft) {
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
}
});
已复制
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
参数 | 类型 | 说明 |
---|---|---|
conversationType | ConversationType | 会话类型 |
targetId | String | 会话 Id |
callback | ResultCallback<String> | 回调接口 |
删除草稿
删除草稿。
ConversationType conversationType = ConversationType.PRIVATE;
String targetId = "会话 Id";
RongIMClient.getInstance().clearTextMessageDraft(conversationType, targetId, new ResultCallback<Boolean>() {
@Override
public void onSuccess(Boolean success) {
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
}
});
已复制
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
参数 | 类型 | 说明 |
---|---|---|
conversationType | ConversationType | 会话类型 |
targetId | String | 会话 Id |
callback | ResultCallback<Boolean> | 回调接口 |