NIMMessage Class Reference

Inherits from NSObject
Declared in NIMMessage.h

Overview

Message object

  messageType

Message type

@property (nonatomic, assign, readonly) NIMMessageType messageType

Discussion

Message type

Declared In

NIMMessage.h

  messageSubType

Message subtype (The default value is 0 The specified value must be greater than 0)

@property (nonatomic, assign) NSInteger messageSubType

Discussion

Message subtype (The default value is 0 The specified value must be greater than 0)

Declared In

NIMMessage.h

  from

Message source

@property (nullable, nonatomic, copy) NSString *from

Discussion

Message source

Declared In

NIMMessage.h

  session

Session a message belongs to

@property (nullable, nonatomic, copy, readonly) NIMSession *session

Discussion

Session a message belongs to

Declared In

NIMMessage.h

  messageId

Unique message identifier

@property (nonatomic, copy, readonly) NSString *messageId

Discussion

Unique message identifier

Declared In

NIMMessage.h

  serverID

Server ID

@property (nonatomic, copy, readonly) NSString *serverID

Discussion

Server ID

Declared In

NIMMessage.h

  text

Text message

@property (nullable, nonatomic, copy) NSString *text

Discussion

Text message

All text fields except NIMMessageTypeText and NIMMessageTypeTip are nil.

Declared In

NIMMessage.h

  messageObject

Message attachment

@property (nullable, nonatomic, strong) id<NIMMessageObject> messageObject

Discussion

Message attachment

Declared In

NIMMessage.h

  setting

Message setting

@property (nullable, nonatomic, strong) NIMMessageSetting *setting

Discussion

Message setting

The field can be specified for settings, such as count as unread, and multi-device sync

Declared In

NIMMessage.h

  antiSpamOption

Anti spam option

@property (nullable, nonatomic, strong) NIMAntiSpamOption *antiSpamOption

Discussion

Anti spam option

Declared In

NIMMessage.h

  apnsContent

Push notification content that can contain up to 500 characters. This field is invalid if the message is recalled

@property (nullable, nonatomic, copy) NSString *apnsContent

Discussion

Push notification content that can contain up to 500 characters. This field is invalid if the message is recalled

Declared In

NIMMessage.h

  apnsPayload

Push notification payload

@property (nullable, nonatomic, copy) NSDictionary *apnsPayload

Discussion

Push notification payload

The field can contain a custom payload. For more information about supported fields, see the official Apple documentation on APNs. The payload can contain 2000 characters. This field is invalid if the message is recalled.

Declared In

NIMMessage.h

  apnsMemberOption

Member option for APNs

@property (nullable, nonatomic, strong) NIMMessageApnsMemberOption *apnsMemberOption

Discussion

Member option for APNs

This option is used for some complex push use cases. Currently the option is only available for group chats.

Declared In

NIMMessage.h

  remoteExt

Server extension

@property (nullable, nonatomic, copy) NSDictionary *remoteExt

Discussion

Server extension

You can set this field on the client. This field will be stored locally and sent to the peer. The upper layer can convert NSDictionary to a JSON file. The length of the field is limited to 1000 characters

Declared In

NIMMessage.h

  localExt

Local extension

@property (nullable, nonatomic, copy) NSDictionary *localExt

Discussion

Local extension

You can set this field on the client. This field will be stored locally and sent to the peer. The upper layer can convert NSDictionary to a JSON file.

Declared In

NIMMessage.h

  messageExt

Message extension field

@property (nullable, nonatomic, strong) id messageExt

Discussion

Message extension field

The message extension field sent by the server is not persisted locally. Currently, only the messages in the chat room have this field (NIMMessageChatroomExtension)

Declared In

NIMMessage.h

  timestamp

The time when a message is sent

@property (nonatomic, assign) NSTimeInterval timestamp

Discussion

The time when a message is sent

The message stored locally can adjust its position in the session list by modifying the timestamp, and the timestamp of the message sent to the server will be automatically corrected by the server.

Declared In

NIMMessage.h

  yidunAntiCheating

Fields for GuardEase anti-cheating

@property (nullable, nonatomic, copy) NSDictionary *yidunAntiCheating

Discussion

Fields for GuardEase anti-cheating

The data in the fields for anti-cheating provided by GuardEase are transferred in pass-through mode

Declared In

NIMMessage.h

  yidunAntiSpamExt

Extension field for GuardEase anti-spam in JSON format. 1024 characters are allowed.

@property (nullable, nonatomic, copy) NSString *yidunAntiSpamExt

Discussion

Extension field for GuardEase anti-spam in JSON format. 1024 characters are allowed.

Declared In

NIMMessage.h

  yidunAntiSpamRes

The result returned by GuardEase

@property (nullable, nonatomic, copy) NSString *yidunAntiSpamRes

Discussion

The result returned by GuardEase

Declared In

NIMMessage.h

  locationX

X coordinate for chat room only

@property (nonatomic, copy) NSNumber *locationX

Discussion

X coordinate for chat room only

Declared In

NIMMessage.h

  locationY

Y coordinate for chat room only

@property (nonatomic, copy) NSNumber *locationY

Discussion

Y coordinate for chat room only

Declared In

NIMMessage.h

  locationZ

Z coordinate for chat room only

@property (nonatomic, copy) NSNumber *locationZ

Discussion

Z coordinate for chat room only

Declared In

NIMMessage.h

  toAccIds

List of recipients for chat room only

@property (nonatomic, copy) NSArray<NSString*> *toAccIds

Discussion

List of recipients for chat room only

Declared In

NIMMessage.h

  notifyTargetTags

the target tag expression

@property (nullable, nonatomic, copy) NSString *notifyTargetTags

Discussion

the target tag expression

Declared In

NIMMessage.h

  env

The environment variable

@property (nullable, nonatomic, copy) NSString *env

Discussion

The environment variable

The environment variable used to point to different types of configurations for state sync and third-party callbacks.

Declared In

NIMMessage.h

  deliveryState

Message delivery state for delivered messages

@property (nonatomic, assign, readonly) NIMMessageDeliveryState deliveryState

Discussion

Message delivery state for delivered messages

Declared In

NIMMessage.h

  attachmentDownloadState

Message attachment download states for received messages

@property (nonatomic, assign, readonly) NIMMessageAttachmentDownloadState attachmentDownloadState

Discussion

Message attachment download states for received messages

Declared In

NIMMessage.h

  isReceivedMsg

Check if it is a received message

@property (nonatomic, assign, readonly) BOOL isReceivedMsg

Discussion

Check if it is a received message

Since roaming messages sent by the current user are still regarded as received messages. This field is used to evaluate whether the message needs to be resent or re-received when an error occurred

Declared In

NIMMessage.h

  isOutgoingMsg

Check if it is an outgoing message

@property (nonatomic, assign, readonly) BOOL isOutgoingMsg

Discussion

Check if it is an outgoing message

Since you can send messages to yourself, not all messages from yourself are outgoing messages. This field is used to determine the layout position of the avatar (left or right).

Declared In

NIMMessage.h

  isPlayed

Check whether the message has been played

@property (nonatomic, assign) BOOL isPlayed

Discussion

Check whether the message has been played

Editing the property will modify the data in the database. In chat room messages, this field is invalid.

Declared In

NIMMessage.h

  isDeleted

Check whether the message is marked as deleted

@property (nonatomic, assign, readonly) BOOL isDeleted

Discussion

Check whether the message is marked as deleted

Deleted messages will be filtered out when getting the local message list, and only the interface that gets messages based on messageId may return deleted messages. In chat room messages, this field is invalid.

Declared In

NIMMessage.h

  isRemoteRead

Check if a message is read by the peer

@property (nonatomic, assign, readonly) BOOL isRemoteRead

Discussion

Check if a message is read by the peer

The interface is valid only if the message is of P2P type and isOutgoingMsg is set to YES. The peer must call the interface to send a read receipt for the message.

Declared In

NIMMessage.h

  isTeamReceiptSended

Read receipt of a message is sent in a group chat

@property (nonatomic, assign, readonly) BOOL isTeamReceiptSended

Discussion

Read receipt of a message is sent in a group chat

the interface is only valid for group messages

Declared In

NIMMessage.h

  teamReceiptInfo

Group read receipt

@property (nullable, nonatomic, strong, readonly) NIMTeamMessageReceipt *teamReceiptInfo

Discussion

Group read receipt

The interface is valid only if the message is of team type and teamReceiptEnabled is set to YES. The peer must call the interface to send a read receipt for a message.

Declared In

NIMMessage.h

  senderName

/** Sender name * @discussion If the sender is the current user, this value may be empty. This value represents the sender’s nickname, not the one when the message was sent. In chat room messages, this field is invalid.

@property (nullable, nonatomic, copy, readonly) NSString *senderName

Discussion

/** Sender name * @discussion If the sender is the current user, this value may be empty. This value represents the sender’s nickname, not the one when the message was sent. In chat room messages, this field is invalid.

Declared In

NIMMessage.h

  senderClientType

Client type of a sender

@property (nonatomic, assign, readonly) NIMLoginClientType senderClientType

Discussion

Client type of a sender

Declared In

NIMMessage.h

  isBlackListed

Check if the user is in the blacklist

@property (nonatomic, assign, readonly) BOOL isBlackListed

Discussion

Check if the user is in the blacklist

YES: in the blacklist

Declared In

NIMMessage.h

  repliedMessageId

The message ID of the target message the message replies to

@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageId

Discussion

The message ID of the target message the message replies to

empty if no other message was replied to

Message A is a regular message and message B is a reply to message A. In this case, message A is the replied message and thread message of message B. In addition, message C is a reply to message B, then the replied message of message C is message B, and thread message of message C is message A.

Declared In

NIMMessage.h

  repliedMessageServerId

The server ID of the target message the message replies to

@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageServerId

Discussion

The server ID of the target message the message replies to

empty if no other message was replied to

Declared In

NIMMessage.h

  repliedMessageFrom

The sender of the target message the message replies to

@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageFrom

Discussion

The sender of the target message the message replies to

empty if no other message was replied to

Declared In

NIMMessage.h

  repliedMessageTo

The recipient of the target message the message replies to

@property (nullable, nonatomic, copy, readonly) NSString *repliedMessageTo

Discussion

The recipient of the target message the message replies to

empty if no other message was replied to

Declared In

NIMMessage.h

  repliedMessageTime

The sent timestamp of the target message the message replies to

@property (nonatomic, assign, readonly) NSTimeInterval repliedMessageTime

Discussion

The sent timestamp of the target message the message replies to

empty if no other message was replied to

Declared In

NIMMessage.h

  threadMessageId

The message ID of the parent message of the target message

@property (nullable, nonatomic, copy, readonly) NSString *threadMessageId

Discussion

The message ID of the parent message of the target message

empty if no other message was replied to

Declared In

NIMMessage.h

  threadMessageServerId

The server ID of the parent message

@property (nullable, nonatomic, copy, readonly) NSString *threadMessageServerId

Discussion

The server ID of the parent message

empty if no other message was replied to

Declared In

NIMMessage.h

  threadMessageFrom

The sender of the parent message

@property (nullable, nonatomic, copy, readonly) NSString *threadMessageFrom

Discussion

The sender of the parent message

empty if no other message was replied to

Declared In

NIMMessage.h

  threadMessageTo

The recipient of the target message the message replies to

@property (nullable, nonatomic, copy, readonly) NSString *threadMessageTo

Discussion

The recipient of the target message the message replies to

empty if no other message was replied to

Declared In

NIMMessage.h

  threadMessageTime

The timestamp of the parent message

@property (nonatomic, assign, readonly) NSTimeInterval threadMessageTime

Discussion

The timestamp of the parent message

empty if no other message was replied to

Declared In

NIMMessage.h

  callbackExt

Custom extension field returned by a third party callback

@property (nonatomic, copy, readonly) NSString *callbackExt

Discussion

Custom extension field returned by a third party callback

Declared In

NIMMessage.h

  status

Message status

@property (nonatomic, assign) NIMMessageStatus status

Discussion

Message status

Declared In

NIMMessage.h