Visual Communication: Image messages enable rich visual communication by allowing users to share photos, screenshots, and visual content with automatic upload handling, caption support, and cross-platform compatibility.

Image Messaging Overview

Image messages provide powerful visual communication capabilities, allowing users to share photos, screenshots, documents, and other visual content with automatic upload processing and metadata support.

Automatic Upload

Seamless file handling
  • Automatic image upload and processing
  • Progress tracking and status updates
  • Multiple format support (JPEG, PNG, GIF, WebP)
  • Optimized compression and quality

Rich Features

Enhanced visual messaging
  • Caption and text overlay support
  • Thumbnail generation
  • Metadata and tagging
  • Threading and reply support

Platform Implementation

Unified image handling with automatic uploadMobile SDKs provide streamlined image messaging with automatic upload processing, eliminating the need for separate upload steps.

Required Parameters

ParameterTypeDescription
subChannelIdStringTarget subchannel identifier for the image message
attachmentImage/URILocal image file path or URI reference

Optional Parameters

ParameterTypeDescription
captionStringText caption or description for the image
tagsArray<String>Message categorization and filtering tags
parentIdStringParent message ID for threaded conversations
metadataObjectCustom properties for extended functionality

Implementation Examples

// Create image message with local file
let imageUrl = URL(fileURLWithPath: "/path/to/local/image.jpg")
let options = AmityImageMessageCreateOptions(
    subChannelId: "subChannel-123",
    attachment: .localURL(url: imageUrl),
    caption: "Check out this amazing sunset! 🌅",
    fullImage: true,
    tags: ["photos", "nature", "sunset"],
    parentId: nil
)

do {
    let message = try await messageRepository.createImageMessage(options: options)
    print("Image message sent: \(message.messageId)")
} catch {
    // Handle upload or creation error
    print("Failed to send image: \(error)")
}
Automatic Processing: Mobile SDKs handle image upload, compression, and message creation in a single operation, providing seamless user experience with progress tracking.

Image Message Features

Implementation Strategy: Start with basic image messaging using platform-specific patterns (unified upload for mobile, two-step for web), then add features like captions, metadata, and threading. Always implement proper progress feedback and error handling for optimal user experience.