HyphenateChatSDK 4.0.0
Instance Methods | Properties | List of all members
EMChatMessage Class Reference

#import <EMChatMessage.h>

Inheritance diagram for EMChatMessage:

Instance Methods

(EMMessageReaction *_Nullable) - getReaction:
 
(id _Nonnull) - initWithConversationID:from:to:body:ext:
 
(id _Nonnull) - initWithConversationID:body:ext:
 

Properties

NSString *_Nonnull messageId
 
NSString *_Nonnull conversationId
 
EMMessageDirection direction
 
NSString *_Nonnull from
 
NSString *_Nonnull to
 
long long timestamp
 
long long localTime
 
EMChatType chatType
 
EMMessageStatus status
 
BOOL onlineState
 
BOOL isReadAcked
 
BOOL isChatThreadMessage
 
BOOL isNeedGroupAck
 
int groupAckCount
 
BOOL isDeliverAcked
 
BOOL isRead
 
BOOL isListened
 
EMMessageBody *_Nonnull body
 
NSArray< EMMessageReaction * > *_Nullable reactionList
 
NSDictionary *_Nullable ext
 
EMChatThread *_Nullable chatThread
 
EMChatRoomMessagePriority priority
 

Detailed Description

The chat message class.

Method Documentation

◆ getReaction:

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

Gets the Reaction content by the Reaction ID.

Parameters
reactionThe Reaction ID.
Returns
The Reaction content.

◆ initWithConversationID:body:ext:

- (id _Nonnull) initWithConversationID: (NSString *_Nonnull)  aConversationId
body: (EMMessageBody *_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:

- (id _Nonnull) initWithConversationID: (NSString *_Nonnull)  aConversationId
from: (NSString *_Nonnull)  aFrom
to: (NSString *_Nonnull)  aTo
body: (EMMessageBody *_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

- (EMMessageBody* _Nonnull) body
readwritenonatomicstrong

The message body.

◆ chatThread

- (EMChatThread* _Nullable) chatThread
readatomicassign

Gets an overview of the thread in the message.

Currently, this attribute is valid only for group messages.

◆ chatType

- (EMChatType) chatType
readwritenonatomicassign

The chat type.

◆ conversationId

- (NSString* _Nonnull) conversationId
readwritenonatomiccopy

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

◆ direction

- (EMMessageDirection) 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.

◆ isDeliverAcked

- (BOOL) isDeliverAcked
readwritenonatomicassign

Whether the delivery receipt is sent or received:

  • YES: Yes;
  • NO: No.

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

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

If you set enableDeliveryAck in EMOptions 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.

◆ priority

- (EMChatRoomMessagePriority) priority
readwritenonatomicassign

Sets the delivery priority of a chat room message.

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

The default value is normal.

◆ reactionList

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

The Reaction list.

◆ status

- (EMMessageStatus) status
readwritenonatomicassign

The message delivery status. See EMMessageStatus.

◆ 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: