Skip to main content

Like Comment

Within the LikeMinds iOS Feed SDK, users can express their appreciation for a comment by "liking" it. This feature allows members to indicate their support or agreement with a particular comment in a simple and intuitive manner. By providing the ability to like comments, the SDK enhances user engagement and facilitates positive interactions within the application's comment section.

Steps to like a comment

  1. Create a LikeCommentRequest object using LikeCommentRequest.builder() class by passing all the required parameters.
  2. Call likeComment() function using the instance of LMFeedClient.
  3. Process the response LMResponse<NoData> as per your requirement.
// object of LikeCommentRequest
let request = LikeCommentRequest.builder()
.postId(ENTER_POST_ID) // post id of the liked comment
.commentId(ENTER_COMMENT_ID) // id of the comment liked
.build()
LMFeedClient.shared.likeComment(request) { response in
// response (LMResponse<NoData>)
if (response.success) {
// your function to process comment liked action
processResponse()
} else {
// your function to process error message
processError(response.errorMessage)
}
}
note

Same function can be used to like a reply as well. Just pass the id of the reply as comment id.

Models

LikeCommentRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
postIdStringPost ID of the liked comment.
commentIdStringUnique ID of the comment liked.