Skip to main content

Like Post

The LikeMinds iOS Feed SDK incorporates a "like" feature that enables users to express their appreciation for posts by other members. With just a simple tap, users can indicate their interest and support for specific content on their feed.

Steps to like a post

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

Models

LikePostRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
postIdStringUnique id of the post liked.