Skip to main content

Reply Comment

The LikeMinds Android Feed SDK offers the ability to reply to comments, enabling users to engage in threaded discussions within the application.

Steps to reply on a comment

  1. Create a ReplyCommentRequest object using ReplyCommentRequest.Builder class by passing all the required parameters.
  2. Call replyComment() function using the instance of LMFeedClient.
  3. Process the response (LMResponse<ReplyCommentResponse>) as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// object of ReplyCommentRequest
val replyCommentRequest = ReplyCommentRequest.Builder()
.postId("ENTER POST ID") // id of the post on which member has replied
.commentId("ENTER COMMENT ID") // id of the comment on which member has replied
.text("ENTER REPLY TEXT") // reply text
.tempId("ENTER REPLY TEMPORARY ID") // temporary id of the comment
.build()
// get response (LMResponse<ReplyCommentResponse>)
val response = LMFeedClient.getInstance().replyComment(replyCommentRequest)
if (response.success) {
// your function to process the response dataa
processReplyCommentResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

ReplyCommentRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
postIdStringID of the post on which member has replied.
commentIdStringID of the comment on which member has replied.
textStringText content of the reply.

ReplyCommentResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
commentCommentObject of the added reply.
usersMap<String, User>Map of user unique id to user object.