AgoraChatSDK 1.3.1
Instance Methods | Properties | List of all members
AgoraChatMessage Class Reference

#import <AgoraChatMessage.h>

Inheritance diagram for AgoraChatMessage:

Instance Methods

(AgoraChatMessageReaction *_Nullable) - getReaction:
 
(instancetype _Nonnull) - initWithConversationID:from:to:body:ext:
 
(instancetype _Nonnull) - initWithConversationID:body:ext:
 

Properties

NSString *_Nonnull messageId
 
NSString *_Nonnull conversationId
 
AgoraChatMessageDirection direction
 
NSString *_Nonnull from
 
NSString *_Nonnull to
 
long long timestamp
 
long long localTime
 
AgoraChatType chatType
 
AgoraChatMessageStatus status
 
BOOL onlineState
 
BOOL isReadAcked
 
BOOL isChatThreadMessage
 
BOOL isNeedGroupAck
 
int groupAckCount
 
BOOL isDeliverAcked
 
BOOL isRead
 
BOOL isListened
 
AgoraChatMessageBody *_Nonnull body
 
NSArray< AgoraChatMessageReaction * > *_Nullable reactionList
 
NSDictionary *_Nullable ext
 
AgoraChatThread *_Nullable chatThread
 
AgoraChatRoomMessagePriority priority
 
BOOL broadcast
 
BOOL deliverOnlineOnly
 
NSArray< NSString * > *_Nullable receiverList
 
BOOL isContentReplaced
 
AgoraChatMessagePinInfo *_Nullable pinnedInfo
 

Detailed Description

The chat message class.

Method Documentation

◆ getReaction:

- (AgoraChatMessageReaction *_Nullable) getReaction: (NSString *_Nonnull)  reaction

Gets the Reaction content by the Reaction ID.

Parameters
reactionThe Reaction ID.
Returns
The Reaction content.

◆ initWithConversationID:body:ext:

- (instancetype _Nonnull) initWithConversationID: (NSString *_Nonnull)  aConversationId
body: (AgoraChatMessageBody *_Nonnull)  aBody
ext: (NSDictionary *_Nullable)  aExt 

Initializes a message instance.

Parameters
aConversationIdThe conversation ID.
aBodyThe message body.
aExtThe message extention.
Returns
The message instance.

◆ initWithConversationID:from:to:body:ext:

- (instancetype _Nonnull) initWithConversationID: (NSString *_Nonnull)  aConversationId
from: (NSString *_Nonnull)  aFrom
to: (NSString *_Nonnull)  aTo
body: (AgoraChatMessageBody *_Nonnull)  aBody
ext: (NSDictionary *_Nullable)  aExt 

Initializes a message instance.

Parameters
aConversationIdThe conversation ID.
aFromThe user that sends the message.
aToThe user that receives the message.
aBodyThe message body.
aExtThe message extention.
Returns
The message instance.

Property Documentation

◆ body

- (AgoraChatMessageBody* _Nonnull) body
readwritenonatomicstrong

The message body.

◆ broadcast

- (BOOL) broadcast
readnonatomicassign

Whether it is a broadcast message

◆ chatThread

- (AgoraChatThread* _Nullable) chatThread
readatomicassign

Gets an overview of the thread in the message.

Currently, this attribute is valid only for group messages.

◆ chatType

- (AgoraChatType) chatType
readwritenonatomicassign

The chat type.

◆ conversationId

- (NSString* _Nonnull) conversationId
readwritenonatomiccopy

The conversation ID, which is the unique identifier of the conversation.

◆ deliverOnlineOnly

- (BOOL) deliverOnlineOnly
readwritenonatomicassign

Whether the message is delivered only when the recipient(s) is/are online:

  • YES:The message is delivered only when the recipient(s) is/are online. If the recipient is offline, the message is not delivered.
  • (Default) NO:The message is delivered to the recipients regardless of whether they are online or offline.

◆ direction

- (AgoraChatMessageDirection) direction
readwritenonatomicassign

The message delivery direction.

◆ ext

- (NSDictionary* _Nullable) ext
readwritenonatomiccopy

The custom message extension.

This data is in the key-value format, where the key is the extension field name of the NSString type, and the value must be of the NSString or NSNumber (Bool, Int, unsigned int, long long, double) type.

◆ from

- (NSString* _Nonnull) from
readwritenonatomiccopy

The user sending the message.

◆ groupAckCount

- (int) groupAckCount
readnonatomicassign

The number of read receipts received for group messages.

◆ isChatThreadMessage

- (BOOL) isChatThreadMessage
readwritenonatomicassign

Whether this message is sent within a thread:

  • YES: Yes;
  • NO: No.

◆ isContentReplaced

- (BOOL) isContentReplaced
readnonatomicassign

Whether the message content has been replaced by server.This property is used only when AgoraChatOptions::useReplacedMessageContent is true.

◆ isDeliverAcked

- (BOOL) isDeliverAcked
readwritenonatomicassign

Whether the delivery receipt is sent or received:

  • YES: Yes;
  • NO: No.

For the message sender, this attribute indicates whether the delivery receipt is received.

For the message recipient, this attribute indicates whether the delivery receipt is sent.

If you set enableDeliveryAck in AgoraChatOptions as YES, the SDK automatically sends the delivery receipt after receiving a message.

◆ isListened

- (BOOL) isListened
readwritenonatomicassign

Whether the voice message is played.

  • YES: Yes;
  • NO: No.

◆ isNeedGroupAck

- (BOOL) isNeedGroupAck
readwritenonatomicassign

Whether read receipts are required for group messages.

  • YES: Yes;
  • NO: No.

◆ isRead

- (BOOL) isRead
readwritenonatomicassign

Whether the message is read.

  • YES: Yes;
  • NO: No.

◆ isReadAcked

- (BOOL) isReadAcked
readwritenonatomicassign

Whether the message read receipt is sent (from the message recipient) or received (by the message sender).

  • YES: Yes;
  • NO: No.

◆ localTime

- (long long) localTime
readwritenonatomicassign

The Unix timestamp for the local client sending or receiving the message.

The unit is millisecond.

◆ messageId

- (NSString* _Nonnull) messageId
readwritenonatomiccopy

The message ID, which is the unique identifier of the message.

◆ onlineState

- (BOOL) onlineState
readnonatomicassign

Whether the message is an online message:

  • YES: online message.
  • NO: offline message.

This message status is not stored in the local database.

Messages read from the database or pulled from the server are regarded as online.

◆ pinnedInfo

- (AgoraChatMessagePinInfo* _Nullable) pinnedInfo
readnonatomicassign

The message pinning information.

For a message that is not pinned, nil is returned.

◆ priority

- (AgoraChatRoomMessagePriority) priority
readwritenonatomicassign

Sets the priority of a chat room message.

Currently, this attribute is valid only for chat room messages.

The default value is normal, indicating the normal priority.

◆ reactionList

- (NSArray<AgoraChatMessageReaction *>* _Nullable) reactionList
readnonatomicassign

The Reaction list.

◆ receiverList

- (NSArray<NSString*>* _Nullable) receiverList
readwritenonatomicstrong

The recipient list of a targeted message.

This property is used only for messages in groups and chat rooms. If you pass in nil, the messages are sent to all members in the group or chat room.

◆ status

- (AgoraChatMessageStatus) status
readwritenonatomicassign

The message delivery status. See AgoraChatMessageStatus.

◆ timestamp

- (long long) timestamp
readwritenonatomicassign

The Unix timestamp for the chat server receiving the message.

The unit is second.

◆ to

- (NSString* _Nonnull) to
readwritenonatomiccopy

The user receiving the message.


The documentation for this class was generated from the following file: