- Android
- iOS
- JavaScript
- 鸿蒙
参数说明
名称 | 类型 | 描述 | 版本 |
---|---|---|---|
conversation | Conversation | 会话标识 | 1.0.0 |
count | int | 拉取数量 | 1.0.0 |
time | long | 消息时间戳,如果传 0 为当前时间 | 1.0.0 |
direction | JIMConst.PullDirection | 拉取方向 | 1.0.0 |
callback | IMessageManager.IGetMessagesWithFinishCallback | 拉取回调 | 1.0.0 |
示例代码
Conversation conversation = new Conversation(Conversation.ConversationType.GROUP, "groupId1");
JIM.getInstance().getMessageManager().getMentionMessageList(conversation, 100, 0, JIMConst.PullDirection.OLDER, new IMessageManager.IGetMessagesWithFinishCallback() {
@Override
public void onSuccess(List<Message> messages, boolean isFinished) {
}
@Override
public void onError(int errorCode) {
}
});
参数说明
名称 | 类型 | 描述 | 版本 |
---|---|---|---|
conversation | JConversation | 会话标识 | 1.0.0 |
count | int | 拉取数量 | 1.0.0 |
time | long | 消息时间戳,如果传 0 为当前时间 | 1.0.0 |
direction | JPullDirection | 拉取方向 | 1.0.0 |
successBlock | 成功回调 | 1.0.0 | |
errorBlock | 失败回调 | 1.0.0 |
示例代码
JConversation *conversation = [[JConversation alloc] initWithConversationType:JConversationTypeGroup conversationId:@"groupId1"];
[JIM.shared.messageManager getMentionMessages:conversation
count:100
time:0
direction:JPullDirectionOlder
success:^(NSArray<JMessage *> *messages, BOOL isFinished) {
} error:^(JErrorCode code) {
}];
参数说明
名称 | 类型 | 必填 | 默认值 | 描述 | 版本 |
---|---|---|---|---|---|
conversation | Object | 是 | 会话对象 | 1.0.0 | |
conversation.conversationType | Number | 是 | 会话类型 | 1.0.0 | |
conversation.conversationId | String | 是 | 会话 Id | 1.0.0 | |
conversation.messageIndex | Number | 否 | 0 | 消息索引,查询 @ 消息会以 messageIndex 为起始点向前或向后获取 count 条消息 | 1.0.0 |
conversation.count | Number | 否 | 20 | 获取消息条数 | 1.0.0 |
conversation.order | Number | 否 | BACKWARD | 获取方向 | 1.0.0 |
回调说明
属性 | 类型 | 描述 | 版本 |
---|---|---|---|
result | Object | 查询结果 | 1.0.0 |
result.isFinished | Boolean | @ 消息是否查询完成,false 表示服务端还有更多的 @ 消息列表 | 1.0.0 |
result.msgs | Array | @ 消息列表,获取消息内容可通过 按 ID 查询消息 获取 | 1.0.0 |
示例代码
let { ConversationType, MentionOrder } = JIM;
let conversation = {
conversationType: ConversationType.GROUP,
conversationId: 'groupid1',
count: 10,
messageIndex: 0,
order: MentionOrder.BACKWARD
};
jim.getMentionMessages(conversation).then((result) => {
let { isFinished, msgs } = result;
console.log(isFinished, msgs);
})
参数说明
名称 | 类型 | 描述 | 版本 |
---|---|---|---|
conver | Conversation | 会话标识 | 1.0.0 |
count | number | 拉取数量 | 1.0.0 |
startTime | number | 消息时间戳,如果传 0 为当前时间 | 1.0.0 |
isPositive | boolean | 拉取方向,true:正序;false:倒序 | 1.0.0 |
callback | QryMessagesCallback | 拉取回调 | 1.0.0 |
示例代码
let conver = new Conversation("userid1",1)
JuggleIm.instance.getMessageManager().queryMentionMessages(conver,100,0,false,(code,msgs,hasMore)=>{
})