Skip to main content

Add a comment. Replies to another user's comment are also supported.

API Reference

/**
* post a comment
* @param momentId ID of the Moments post being commented on
* @param parentCommentId parent comment ID; may be empty
* @param content comment content
* @param callback result callback
*/
void addComment(String momentId, String parentCommentId, String content, JIMConst.IResultCallback<MomentComment> callback);

Code Example

// "parentCommentId" may be empty
JIM.getInstance().getMomentManager().addComment("momentId", "parentCommentId", "Good picture!", new JIMConst.IResultCallback<MomentComment>() {
@Override
public void onSuccess(MomentComment data) {
}

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