Skip to main content

Reply Comment

The iOS Feed SDK offers the ability to reply to comments, enabling users to engage in threaded discussions within the application. By leveraging this feature, users can respond directly to specific comments, facilitating more focused conversations and enhancing the overall interactivity and depth of discussions on the platform.

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.
// object of ReplyCommentRequest
let request = ReplyCommentRequest.builder()
.postId(ENTER_POST_ID) // post id of the liked comment
.commentId(ENTER_COMMENT_ID) // id of the comment liked
.text("Reply text") // reply text
.tempId(ENTER_TEMP_ID) // temporary id of the comment
.build()
LMFeedClient.shared.replyComment(request) { response in
// response (LMResponse<ReplyCommentResponse>)
if (response.success) {
// your function to process the response data
processResponse(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
tempIdStringTemporary ID for Comment

ReplyCommentResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
commentCommentObject of the added reply.
users[String: User]Dictionary of user unique id to user object.