Skip to main content

Get the comment list for a Moment. Pagination before or after a specified time is supported.

GetMomentCommentOption Structure

NameTypeDescriptionVersion
momentIdStringMoment ID1.8.30
countintRetrieve the specified number of comments, up to 20 records per request1.8.30
directionJIMConst.PullDirectionRetrieval direction. Use startTime to retrieve older or newer comments.1.8.30
startTimelongStart time for retrieving comments. Use with direction; 0 uses the current time.1.8.30

API Reference

/**
* get the comment list
* @param option retrieval options
* @param callback result callback
*/
void getCommentList(GetMomentCommentOption option, JIMConst.IResultListCallback<MomentComment> callback);

Code Example

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) {
}
});