Skip to main content

获取朋友圈的评论列表,支持按指定时间前后分页获取。

GetMomentCommentOption 结构

名称类型描述版本
momentIdString朋友圈 ID1.8.30
countint获取指定数量的评论,单次最多获取 20 条记录1.8.30
directionJIMConst.PullDirection获取方向,支持按 startTime 获取更早的评论或者更(四声)新的评论1.8.30
startTimelong从指定时间点开始获取评论,可以配合 direction 使用,传 0 时表示使用当前时间1.8.30

接口说明

/**
* 获取评论列表
* @param option 获取参数
* @param callback 结果回调
*/
void getCommentList(GetMomentCommentOption option, JIMConst.IResultListCallback<MomentComment> callback);

示例代码

GetMomentCommentOption o = new GetMomentCommentOption();
o.setCount(20);
o.setDirection(JIMConst.PullDirection.OLDER);
o.setMomentId("momentId");
JIM.getInstance().getMomentManager().getCommentList(o, new JIMConst.IResultListCallback<MomentComment>() {
@Override
public void onSuccess(List<MomentComment> data, boolean isFinish) {
}

@Override
public void onError(int errorCode) {
}
});