social.plus SDK empowers developers to create compelling ephemeral content through Stories, supporting both image and video formats with rich interactive elements. Build multimedia experiences with hyperlinks, custom overlays, and comprehensive analytics tracking to engage your community.

Image Stories

Create visual stories with images up to 1GB with flexible display modes

Video Stories

Share video content up to 2GB with 90-second duration limits

Interactive Elements

Enhance stories with hyperlinks and custom overlays for user engagement

Optimistic Creation

Real-time sync states provide immediate feedback during story creation

Story Types and Specifications

social.plus Stories support two primary content types, each optimized for different use cases and engagement patterns:

Image Stories

  • File Size: Up to 1GB per image
  • Formats: Standard image formats (JPEG, PNG, GIF)
  • Display Modes: Flexible presentation options (FIT/FILL)
  • Use Cases: Visual announcements, product showcases, event highlights

Video Stories

  • File Size: Up to 2GB per video
  • Duration: Maximum 90 seconds (configurable at network level)
  • Formats: Standard video formats (MP4, MOV)
  • Use Cases: Behind-the-scenes content, tutorials, live moments
Duration limits and file size restrictions can be adjusted at the network level, providing flexibility for different community needs and technical requirements.

Interactive Story Elements

Enhance your stories with interactive components that drive engagement and provide additional value to viewers: Add clickable links to your stories with custom aliases for seamless navigation to external content. URLs are validated against a configurable whitelist at the network level for security.
PropertyTypeDescription
urlStringThe destination URL for the hyperlink
customTextStringDisplay text or alias for the link

Story Targeting

Stories are created within specific targets to ensure proper content organization and access control:

Supported Target Types

  • Community: Create stories within specific community contexts
  • Target ID: Community identifier where the story will be published
  • Permissions: Respects community-level permissions and access controls

Sync States and Optimistic Creation

social.plus SDK implements optimistic story creation for enhanced user experience, providing immediate feedback through three distinct sync states:

SYNCING

Story is being uploaded and processed on the server

SYNCED

Story successfully created and available to viewers

FAILED

Story creation failed - retry or error handling required

Create Image Story

The createImageStory() function enables creation of visual stories with comprehensive customization options and interactive elements.

Parameters

ParameterTypeRequiredDescription
targetTypeEnumYesType of target (currently supports .community)
targetIdStringYesID of the target community
imageFileFile/URIYesImage file to attach to the story
storyItemsArrayNoInteractive elements like hyperlinks
imageDisplayModeEnumNoDisplay mode: FIT or FILL (default: FIT)
metadataObjectNoCustom properties and additional data
var items: [AmityStoryItem] = []
    
// If you want the story to contain some items
items.append(AmityHyperLinkItem(url: "someURL", customText: "someCustomText"))

// The default for image display mode is `fit`
let options = AmityImageStoryCreateOptions(targetType: .community, tartgetId: "targetId", imageFileURL: URL(string: "pathToYourURL")!, metadata: nil, items: items, imageDisplayMode: .fill)
// Create a image story
do {
    let post = try await storyRepository.createImageStory(options: options)
} catch {
    // Handle error here
}

Create Video Story

The createVideoStory() function allows creation of engaging video content with the same interactive capabilities as image stories.

Parameters

ParameterTypeRequiredDescription
targetTypeEnumYesType of target (currently supports .community)
targetIdStringYesID of the target community
videoFileFile/URIYesVideo file to attach to the story
storyItemsArrayNoInteractive elements like hyperlinks
metadataObjectNoCustom properties and additional data
var items: [AmityStoryItem] = []
    
// If you want the story to contain some items
items.append(AmityHyperLinkItem(url: "someURL", customText: "someCustomText"))

let options = AmityVideoStoryCreateOptions(targetType: .community, tartgetId: "targetId", videoFileURL: URL(string: "pathToYourURL")!, metadata: nil, items: items)
// Create a video story
do {
    let post = try await storyRepository.createVideoStory(options: options)
} catch {
    // Handle error here
}

Best Practices

File Optimization

Compress media files appropriately to balance quality and upload speed

Interactive Elements

Use meaningful hyperlink text that clearly indicates the destination

Error Handling

Always implement proper error handling for failed uploads

Progress Tracking

Monitor sync states to provide user feedback during uploads

Upload Optimization Tips

  • Image Compression: Use appropriate compression levels to maintain quality while reducing file size
  • Video Encoding: Optimize video bitrate and resolution for mobile viewing
  • Network Awareness: Consider implementing retry logic for failed uploads
  • User Feedback: Display upload progress and sync state changes to users