Skip to main content

Pin Post

The LikeMinds Android Feed SDK, allows users to 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<Nothing>) as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// object of PinPostRequest
val pinPostRequest = PinPostRequest.Builder()
.postId("ENTER POST ID") // id of the post pinned
.build()
// get response (LMResponse<Nothing>)
val response = LMFeedClient.getInstance().pinPost(pinPostRequest)
if (response.success) {
// your function to process post pinned action
processPostPin()
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

PinPostRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
postIdStringUnique id of the post pinned.