In a chat application, it's essential to send text messages to each other in real-time, allowing for quick and easy communication. Users can also view previous messages sent and received within the chat, allowing them to reference past conversations as needed.
The sendTextMessage
function is a feature provided by the Amity chat SDK that enables users to send plain text messages in a Subchannel. This function requires two parameters: text
and subchannelId
.
Here is a brief explanation of the function parameters:
text
: A string that contains the text message that the user wants to send. This parameter is mandatory as it contains the actual message content.
subchannelId
: An identifier for the subchannel where the message will be sent. Subchannels are subdivisions within a channel that represent individual topics or chat threads. Messages and interactions occur within subchannels, not the main channel itself.
metaData
: Additional properties to support custom fields.
tags
- Arbitrary strings that can be used for defining and querying for the messages.
Version 6
Version 5 (Maintained)
Version 6
Version 5 (Maintained)
When creating a message, we can also pass the parentId
to make it appear under a parent.
Version 6
Beta (v0.0.1)
The limit for sending text messages is 10,000 characters per text message. Messages exceeding that limit will return an error and will not be sent.