Options
All
  • Public
  • Public/Protected
  • All
Menu
brief

Message JSON keys

param message_elem_array

message_elem_array:array Elem, read-write (required), list of elements in message

param message_conv_id

message_conv_id: Read/Write (optional). Conversation ID of the message.

param message_conv_type

message_conv_type TIMConvType, read/write (optional), the session type to which the message belongs

param message_sender

message_sender: Read/Write (optional). Message sender.

param message_priority

message_priority TIMMsgPriority, read/write (optional), message priority

param message_client_time

message_client_time: Read/Write (optional). Client time.

param message_server_time

message_server_time: Read/Write (optional). Server time.

param message_is_from_self

message_is_from_self: Read/Write (optional). Whether the message sender is the current user.

param message_platform

message_platform: Read/Write (optional). Platform that sends the message.

param message_is_read

message_is_read: Read/Write (optional). Whether the message is read.

param message_is_online_msg

message_is_online_msg: Read/Write (optional). Whether the message is an online message. false (default): common message; true: message that disappears after being viewed.

param message_is_peer_read

message_is_peer_read: Read-only. Whether the message is read by the peer of the conversation.

param message_status

message_status TIMMsgStatus, read/write (optional), message current state

param message_msg_id

message_msg_id: Read-only. Unique ID of the message. kTIMMsgMsgId is recommended.

param message_rand

message_rand: Read-only. Random code of the message.

param message_seq

message_seq: Read-only. Sequence number of the message.

param message_custom_int

Read/Write (optional). Custom integer field (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled).

param message_custom_str

Read/Write (optional). Custom data field (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled).

param message_cloud_custom_str

message_cloud_custom_str: Read/Write (optional). Custom message data (saved in the cloud, will be sent to the peer end, and can still be pulled after the app is uninstalled and reinstalled).

param message_is_excluded_from_unread_count

Read/Write (optional). Whether the message is excluded from the unread count of the conversation. NO (default): included in the unread count of the conversation; YES: excluded from the unread count of the conversation.

param message_group_at_user_array

message_group_at_user_array: Read/Write (optional). UserID list of users that need to be mentioned (@). If you need to @all, pass in kImSDK_MesssageAtALL.

param message_is_forward_message

message_is_forward_message: Write-only (optional). If you need to forward a message, you cannot directly call the sendMessage API to send the original message. You need to set kTIMMsgIsForwardMessage in the original message to true before sending the original message.

param message_sender_profile

message_sender_profile: Read/Write (optional). User profile of the message sender.

param message_sender_group_member_info

message_sender_group_member_info: Read/Write (optional). Information of the message sender in a group. This parameter is only valid in a group conversation. Currently, only the kTIMGroupMemberInfoIdentifier and kTIMGroupMemberInfoNameCard fields can be obtained. You are advised to obtain other fields via the TIMGroupGetMemberInfoList API.

param message_offlie_push_config

message_offlie_push_config OfflinePushConfig, Read and write (optional), offline push settings for messages

note

Note:

Corresponding element sequence:

  • At present, files and voice Elems are not necessarily transmitted in the order in which they were added, and other Elems are in order. However, it is recommended not to rely too much on the Elem order for processing. It should be processed one by one according to the Elem type to prevent the process from crashing under abnormal conditions.

    For group red packet and like notification messages:

  • For live broadcast scenarios, there will be a function of liking and sending red envelopes. Likes have a relatively low priority, and red envelope messages have a higher priority. You can use custom messages for specific message content.CustomElemTo define, when sending a message, the message priority can be defined by kTIMMsgPriority.

    For messages that disappear after being viewed:

  • When the developer sets the TIMMsgIsOnlineMsg field to true, it means that a message that burns after reading is sent. The message has the following characteristics

    One-to-one conversation: when the message is sent, the peer can receive the message only when the peer is online. If the peer is offline, the peer cannot receive the message even if the peer logs in later. Group conversation: when the message is sent, only online members in the group can receive the message. If a member is offline at the time, the member cannot receive the message even if the member logs in later. The message is not saved on the server. The message is not included in the unread message count. The message is not stored locally. Custom fields of the message

  • Developers can add custom fields to the message. If integers (specified through kTIMMsgCustomInt) and binary data (specified through kTIMMsgCustomStr; data must be converted into a string because JSON does not support binary transmission) are customized, different effects can be provided based on the two fields, such as whether voice messages are played. In addition, the values of the two fields are stored locally only and are not synchronized to the server. Therefore, users cannot retrieve these fields when they change devices.

Hierarchy

  • Json_value_msg

Index

Properties

Optional message_client_time

message_client_time?: number

Optional message_cloud_custom_str

message_cloud_custom_str?: string

Optional message_conv_id

message_conv_id?: string

Optional message_conv_type

message_conv_type?: number

Optional message_custom_int

message_custom_int?: number

Optional message_custom_str

message_custom_str?: string

Optional message_elem_array

message_elem_array?: [Elem]

Optional message_group_at_user_array

message_group_at_user_array?: string

Optional message_is_excluded_from_unread_count

message_is_excluded_from_unread_count?: boolean

Optional message_is_forward_message

message_is_forward_message?: boolean

Optional message_is_from_self

message_is_from_self?: boolean

Optional message_is_online_msg

message_is_online_msg?: boolean

Optional message_is_peer_read

message_is_peer_read?: boolean

Optional message_is_read

message_is_read?: boolean

Optional message_msg_id

message_msg_id?: string

Optional message_offlie_push_config

message_offlie_push_config?: Object

Optional message_platform

message_platform?: TIMPlatform

Optional message_priority

message_priority?: number

Optional message_rand

message_rand?: number

Optional message_sender

message_sender?: string

Optional message_sender_group_member_info

message_sender_group_member_info?: GroupMemberInfo

Optional message_sender_profile

message_sender_profile?: Object

Optional message_seq

message_seq?: number

Optional message_server_time

message_server_time?: number

Optional message_status

message_status?: TIMMsgStatus

Optional message_unique_id

message_unique_id?: number

Generated using TypeDoc