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