social.plus SDK provides comprehensive story deletion capabilities with both soft and hard deletion options. Choose the appropriate deletion method based on your content management requirements, data retention policies, and regulatory compliance needs.

Soft Delete

Mark stories as deleted while preserving data for potential recovery

Hard Delete

Permanently remove stories and all associated data from the database

Cache Management

Automatic removal of unsynced stories from local cache

Data Recovery

Soft deleted stories can be restored if needed

Deletion Types Overview

Understanding the differences between soft and hard deletion helps you choose the appropriate method for your content management strategy.
Deletion TypeData PreservationUse Case
Soft Delete✅ Data preserved✅ Content moderation
Hard Delete❌ Data permanently removed✅ GDPR compliance, permanent removal
Hard deletion is irreversible. Once a story is hard deleted, all associated data including reactions, comments, and analytics are permanently removed and cannot be recovered.

Soft Delete Story

Soft deletion marks a story as deleted by setting the isDeleted flag to true, making it invisible to users while preserving all data for potential recovery or compliance purposes.

When to Use Soft Delete

  • Content Moderation: Hide inappropriate content while maintaining evidence
  • User Requests: Allow users to delete their own content
  • Compliance Requirements: Maintain audit trails while hiding content

Parameters

ParameterTypeRequiredDescription
storyIdStringYesUnique identifier of the story to soft delete
do {
    try await storyRepository.softDeleteStory(storyId: "storyId")
    // story successfully soft deleted
} catch {
    // Catch error when deleting
}

Hard Delete Story

Hard deletion permanently removes a story and all associated data including reactions, comments, analytics, and media files from the database. This action is irreversible and should be used carefully.

When to Use Hard Delete

  • GDPR Compliance: Right to be forgotten requests requiring complete data removal
  • Legal Requirements: Court orders or regulatory mandates for data destruction
  • Storage Optimization: Permanent cleanup of obsolete content to reduce storage costs
  • Security Incidents: Complete removal of compromised or malicious content

Parameters

ParameterTypeRequiredDescription
storyIdStringYesUnique identifier of the story to permanently delete
Consider implementing a confirmation workflow for hard deletions, especially for administrator actions, to prevent accidental permanent data loss.
do {
    try await storyRepository.hardDeleteStory(storyId: "storyId")
    // story successfully soft deleted
} catch {
    // Catch error when deleting
}

Compliance Considerations

GDPR Compliance

Use hard delete for “right to be forgotten” requests

Data Retention

Implement appropriate retention policies for different content types

Audit Requirements

Maintain comprehensive deletion logs for compliance reporting

Legal Mandates

Ensure deletion practices meet local and international regulations