#include <IAgoraRtmService.h>
◆ createMessage()
static IMessage* agora::rtm::IMessage::createMessage |
( |
| ) |
|
|
static |
Creates an IMessage instance.
The created IMessage instance can be either for a channel message or for a peer-to-peer message.
You can set the content of the text message later using the setText() method.
- Returns
- An empty text IMessage instance, if the method call succeeds.
◆ getMessageId()
virtual int64_t agora::rtm::IMessage::getMessageId |
( |
| ) |
const |
|
pure virtual |
Gets the ID of the message.
- Returns
- The ID of the current IMessage instance.
◆ getMessageType()
virtual int agora::rtm::IMessage::getMessageType |
( |
| ) |
const |
|
pure virtual |
Gets the message type.
- Returns
- 0: Success.
- < 0: Failure.
◆ setText()
virtual void agora::rtm::IMessage::setText |
( |
const char * |
str | ) |
|
|
pure virtual |
Sets the content of the text message, or the text description of the raw message.
- Parameters
-
str | The content of the text message, or the text description of the raw message. The maximum length is 32 KB. |
◆ getText()
virtual const char* agora::rtm::IMessage::getText |
( |
| ) |
const |
|
pure virtual |
Gets the content of the text messsage, or the text description of the raw message.
- Returns
- The content of the text message or the text description of the raw message.
◆ getRawMessageData()
virtual const unsigned char* agora::rtm::IMessage::getRawMessageData |
( |
| ) |
const |
|
pure virtual |
Get pointer of custom raw message
- Returns
- The content of binary raw message
◆ getRawMessageLength()
virtual int agora::rtm::IMessage::getRawMessageLength |
( |
| ) |
const |
|
pure virtual |
Get length of custom raw message
- Returns
- The length of binary raw message in bytes
◆ setMessageType()
virtual void agora::rtm::IMessage::setMessageType |
( |
int32_t |
type | ) |
|
|
pure virtual |
◆ setRawMessage()
virtual void agora::rtm::IMessage::setRawMessage |
( |
const uint8_t * |
data, |
|
|
int |
length |
|
) |
| |
|
pure virtual |
◆ release()
virtual void agora::rtm::IMessage::release |
( |
| ) |
|
|
pure virtual |