Skip to main content

Delete Post

Users have the capability to delete their own posts, allowing them to easily remove any content they no longer wish to share.

note

Community Managers can also delete other members' posts, but a reason is required.

Follow these steps to delete a post

  1. Create a DeletePostRequest object using DeletePostRequest.builder() class by passing all the required parameters.
  2. Call deletePost() function using the instance of LMFeedClient.
  3. Process the response LMResponse<[NoData]> as per your requirement.
// object of DeletePostRequest
let request = DeletePostRequest.builder()
.postId(ENTER_POST_ID) // id of the post to be deleted
.deleteReason("Reason for post deletion") // reason for deletion required when Community Manager deletes others post
.build()
LMFeedClient.shared.deletePost(request) { response in
// response (LMResponse<NoData>)
if (response.success) {
// your function to process post deleted action
processResponse()
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

DeletePostRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
postIdStringUnique id of the post to be deleted.
deleteReasonStringReason for post deletion.
note

deleteReason is only required when Community Manager deletes other members post.