Skip to main content

Pin Post

In the LikeMinds iOS Feed SDK, users can conveniently "pin" posts, granting them the ability to highlight and prioritize important content on their feed. This feature ensures that selected posts remain prominently displayed at the top of the feed for improved visibility and easy access.

Steps to pin a post

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

Models

PinPostRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
postIdStringUnique id of the post pinned.