Essential Communication: Text messages form the foundation of chat communication, enabling users to send up to 10,000 characters of rich text content with support for mentions, tags, metadata, and real-time delivery across all platforms.

Text Messaging Overview

Text messages provide the core communication functionality in social.plus Chat, supporting plain text, rich formatting, and advanced features like mentions and threading.

Rich Text Support

Flexible content formatting
  • Up to 10,000 characters per message
  • Unicode and emoji support
  • Mention functionality
  • Custom metadata attachment

Real-Time Delivery

Instant communication
  • Immediate local display
  • Background synchronization
  • Delivery status tracking
  • Cross-platform compatibility

Implementation Guide

Simple text message sendingSend plain text messages with essential parameters for immediate communication.

Required Parameters

ParameterTypeDescription
textStringThe text content to send (max 10,000 characters)
subChannelIdStringIdentifier for the subchannel where the message will be sent

Optional Parameters

ParameterTypeDescription
tagsArray<String>Arbitrary strings for message categorization and querying
metadataObjectAdditional custom properties for extended functionality
parentIdStringParent message ID for creating threaded replies

Code Examples

// Basic text message creation
let options = AmityTextMessageCreateOptions(
    subChannelId: "subChannel-123", 
    text: "Hi Amity!", 
    tags: nil, 
    parentId: nil, 
    metadata: nil, 
    mentioneesBuilder: nil
)

do {
    let message = try await messageRepository.createTextMessage(options: options)
    // Message sent successfully
    print("Message ID: \(message.messageId)")
} catch {
    // Handle error here
    print("Failed to send message: \(error)")
}
Character Limit: Text messages are limited to 10,000 characters. Messages exceeding this limit will return an error and will not be sent.

Text Message Features

Implementation Strategy: Start with basic text messaging, then progressively add features like tags for organization, metadata for custom functionality, and threading for organized conversations. Always validate content length and implement proper error handling.