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
- Create a LikeCommentRequest object using
LikeCommentRequest.builder()
class by passing all the required parameters. - Call
likeComment()
function using the instance ofLMFeedClient
. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
postId | String | Post ID of the liked comment. | |
commentId | String | Unique ID of the comment liked. |