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
- Create a ReplyCommentRequest object using
ReplyCommentRequest.Builder
class by passing all the required parameters. - Call
replyComment()
function using the instance ofLMFeedClient
. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
postId | String | ID of the post on which member has replied. | |
commentId | String | ID of the comment on which member has replied. | |
text | String | Text content of the reply. |
ReplyCommentResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
comment | Comment | Object of the added reply. | |
users | Map<String, User> | Map of user unique id to user object. |