Delete Post

In Amity's social SDK, there are two types of post deletion: soft delete and hard delete. When a post is soft deleted, it is simply marked as deleted, with the isDeleted flag set to true in the database. The post still exists in the database, but is no longer visible to users. By contrast, when a post is hard deleted, all associated data, including reactions, comments, child posts, and related data, is permanently removed from the database. This makes it impossible to retrieve the data once it has been hard deleted.

To perform a hard delete, developers can pass a boolean value of true to the delete post method in the PostRepository. For a soft delete, the boolean value should be false. If no deletion type is specified, the default is soft deletion. By offering these two types of post deletion, Amity's social SDK provides developers with flexibility and control over managing their posts and associated data.

Only the owner of the post or an admin can update and/or delete a post.

Hard deletion is only supported via the SDK at this time, and not yet available in the UIKit or Console. To delete a post in Amity's social SDK, developers can use the PostRepository and specify the post ID and the desired deletion type.

Please also note that the file in the post will not be automatically deleted when the post is deleted.

Last updated