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
- Create a LikePostRequest object using
LikePostRequest.builder()
class by passing all the required parameters. - Call
likePost()
function using the instance ofLMFeedClient
. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
postId | String | Unique id of the post liked. |