◆ V2TIMMessage()
◆ getMsgID()
Get the message ID
- Returns
◆ getTimestamp()
Get the message timestamp
- Returns
◆ getSender()
Get the userID of the message sender
- Returns
- Sender's userID
◆ getNickName()
Get the nickname of the message sender
- Returns
- Sender's nickname
◆ getFriendRemark()
String getFriendRemark |
( |
| ) |
|
|
inline |
Get friend remarks. If you have not pulled the friend information or are not a friend, null is returned.
- Returns
- Friend remarks
◆ getFaceUrl()
Get the sender's profile photo URL
- Returns
- Profile photo URL
◆ getNameCard()
For a group message, nameCard is the group name card of the sender.
- Returns
- Group name card
◆ getGroupID()
For a group message, groupID is the message receiving group ID. Otherwise, groupID is null.
- Returns
- Group ID
◆ getUserID()
For a one-to-one message, userID is the conversation user ID. Otherwise, userID is null. Suppose you are chatting with userA, regardless of whether it is a message sent to userA by yourself or a message sent to yourself by userA, the userID here is userA.
- Returns
◆ getStatus()
Query the message status
- Returns
- Message sending status
◆ getElemType()
◆ getTextElem()
If the message type is V2TIM_ELEM_TYPE_TEXT, textElem stores the content of the text message.
◆ getCustomElem()
If the message type is V2TIM_ELEM_TYPE_CUSTOM, customElem stores the content of the custom message.
◆ getImageElem()
If the message type is V2TIM_ELEM_TYPE_IMAGE, imageElem stores the content of the image message.
◆ getSoundElem()
If the message type is V2TIM_ELEM_TYPE_SOUND, soundElem stores the content of the voice message.
◆ getVideoElem()
If the message type is V2TIM_ELEM_TYPE_VIDEO, videoElem stores the content of the video message.
◆ getFileElem()
If the message type is V2TIM_ELEM_TYPE_FILE, fileElem stores the content of the file message.
◆ getLocationElem()
If the message type is V2TIM_ELEM_TYPE_LOCATION, locationElem stores the content of the geographical location message.
◆ getFaceElem()
If the message type is V2TIM_ELEM_TYPE_FACE, faceElem stores the content of the emoji message.
◆ getMergerElem()
If the message type is V2TIM_ELEM_TYPE_RELAY, relayElem stores the content of the forward message.
◆ getGroupTipsElem()
If the message type is V2TIM_ELEM_TYPE_GROUP_TIPS, groupTipsElem stores the content of the group tip message.
◆ getLocalCustomData()
String getLocalCustomData |
( |
| ) |
|
|
inline |
Get custom message data (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled)
- Returns
◆ setLocalCustomData()
void setLocalCustomData |
( |
String |
localCustomData | ) |
|
|
inline |
Set custom message data (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled)
- Parameters
-
◆ getLocalCustomInt()
int getLocalCustomInt |
( |
| ) |
|
|
inline |
Get custom message data (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled)
- Returns
◆ setLocalCustomInt()
void setLocalCustomInt |
( |
int |
localCustomInt | ) |
|
|
inline |
Set custom message data and can be used to mark whether a voice or video message is played (saved locally, will not be sent to the peer end, and will become invalid after the app is uninstalled and reinstalled)
- Parameters
-
◆ setCloudCustomData()
void setCloudCustomData |
( |
String |
data | ) |
|
|
inline |
Set cloud custom data (saved in the cloud, will be sent to the peer end, and can still be pulled after the app is uninstalled and reinstalled)
◆ getCloudCustomData()
String getCloudCustomData |
( |
| ) |
|
|
inline |
◆ isSelf()
Whether the message sender is the current user
◆ isRead()
Whether the message is read by the current user
◆ isPeerRead()
The condition for this field to be YES is that the message timestamp <= the time when the peer marked conversation as read
◆ isNeedReadReceipt()
boolean isNeedReadReceipt |
( |
| ) |
|
|
inline |
Before using this function in group messages, you need to go to the IM console to set the group type supported by read receipts
◆ setNeedReadReceipt()
void setNeedReadReceipt |
( |
boolean |
needReadReceipt | ) |
|
|
inline |
Before using this function in group messages, you need to go to the IM console to set the group type supported by read receipts
◆ getPriority()
◆ getOfflinePushInfo()
Offline push information of the message
◆ getGroupAtUserList()
List<String> getGroupAtUserList |
( |
| ) |
|
|
inline |
◆ getSeq()
Sequence number of the message
Message sequence numbers in group chats are generated in the cloud and are strictly incremented and unique within the group. Message sequence numbers in one-to-one chats are generated locally and cannot be guaranteed to be strictly incremented and unique.
- Returns
◆ getRandom()
Random number of the message
◆ isExcludedFromUnreadCount()
boolean isExcludedFromUnreadCount |
( |
| ) |
|
|
inline |
Get whether the message is excluded from the conversation unread message count
Supported only in 5.3.425 and later versions.
- Returns
- true: excluded from the conversation unread message count; false: included in the conversation unread message count
◆ setExcludedFromUnreadCount()
void setExcludedFromUnreadCount |
( |
boolean |
excludedFromUnreadCount | ) |
|
|
inline |
Whether the message is excluded from the conversation unread message count. false (default): included in the unread message count of the conversation; true: excluded from the conversation unread message count
Supported only in 5.3.425 and later versions.
◆ isExcludedFromLastMessage()
boolean isExcludedFromLastMessage |
( |
| ) |
|
|
inline |
Get whether the message is excluded from the conversation lastMessage
Supported only in 5.4.666 and later versions.
- Returns
- true: excluded from lastMessage; false: included in lastMessage
◆ setExcludedFromLastMessage()
void setExcludedFromLastMessage |
( |
boolean |
excludedFromLastMessage | ) |
|
|
inline |
Whether the message is excluded from the conversation lastMessage. false (default): included in the conversation lastMessage; true: excluded from the conversation lastMessage
Supported only in 5.4.666 and later versions.
◆ toString()
◆ V2TIM_MSG_STATUS_SENDING
final int V2TIM_MSG_STATUS_SENDING = 1 |
|
static |
Message being sent
◆ V2TIM_MSG_STATUS_SEND_SUCC
final int V2TIM_MSG_STATUS_SEND_SUCC = 2 |
|
static |
Message sent successfully
◆ V2TIM_MSG_STATUS_SEND_FAIL
final int V2TIM_MSG_STATUS_SEND_FAIL = 3 |
|
static |
Message fails to be sent
◆ V2TIM_MSG_STATUS_HAS_DELETED
final int V2TIM_MSG_STATUS_HAS_DELETED = 4 |
|
static |
Message deleted
◆ V2TIM_MSG_STATUS_LOCAL_IMPORTED
final int V2TIM_MSG_STATUS_LOCAL_IMPORTED = 5 |
|
static |
Message imported to local storage
◆ V2TIM_MSG_STATUS_LOCAL_REVOKED
final int V2TIM_MSG_STATUS_LOCAL_REVOKED = 6 |
|
static |
Message revoked
◆ V2TIM_PRIORITY_DEFAULT
final int V2TIM_PRIORITY_DEFAULT = 0 |
|
static |
Defaulted to normal priority
◆ V2TIM_PRIORITY_HIGH
final int V2TIM_PRIORITY_HIGH = 1 |
|
static |
High priority, usually used for important messages such as gift messages
◆ V2TIM_PRIORITY_NORMAL
final int V2TIM_PRIORITY_NORMAL = 2 |
|
static |
Normal priority, usually used for common messages
◆ V2TIM_PRIORITY_LOW
final int V2TIM_PRIORITY_LOW = 3 |
|
static |
Low priority, usually used for like messages
◆ V2TIM_ELEM_TYPE_NONE
final int V2TIM_ELEM_TYPE_NONE = 0 |
|
static |
No element
◆ V2TIM_ELEM_TYPE_TEXT
final int V2TIM_ELEM_TYPE_TEXT = 1 |
|
static |
Text message
◆ V2TIM_ELEM_TYPE_CUSTOM
final int V2TIM_ELEM_TYPE_CUSTOM = 2 |
|
static |
Custom message
◆ V2TIM_ELEM_TYPE_IMAGE
final int V2TIM_ELEM_TYPE_IMAGE = 3 |
|
static |
Image message
◆ V2TIM_ELEM_TYPE_SOUND
final int V2TIM_ELEM_TYPE_SOUND = 4 |
|
static |
Voice message
◆ V2TIM_ELEM_TYPE_VIDEO
final int V2TIM_ELEM_TYPE_VIDEO = 5 |
|
static |
Video message
◆ V2TIM_ELEM_TYPE_FILE
final int V2TIM_ELEM_TYPE_FILE = 6 |
|
static |
File message
◆ V2TIM_ELEM_TYPE_LOCATION
final int V2TIM_ELEM_TYPE_LOCATION = 7 |
|
static |
Geographical location message
◆ V2TIM_ELEM_TYPE_FACE
final int V2TIM_ELEM_TYPE_FACE = 8 |
|
static |
Emoji message
◆ V2TIM_ELEM_TYPE_GROUP_TIPS
final int V2TIM_ELEM_TYPE_GROUP_TIPS = 9 |
|
static |
Group tip message (saved in a message list)
◆ V2TIM_ELEM_TYPE_MERGER
final int V2TIM_ELEM_TYPE_MERGER = 10 |
|
static |
Forward message
◆ V2TIM_RECEIVE_MESSAGE
final int V2TIM_RECEIVE_MESSAGE = 0 |
|
static |
Messages will be received when the user is online, and offline push notifications will be received when the user is offline
◆ V2TIM_NOT_RECEIVE_MESSAGE
final int V2TIM_NOT_RECEIVE_MESSAGE = 1 |
|
static |
No message will be received
◆ V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE
final int V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE = 2 |
|
static |
Messages will be received when the user is online, and no push notification will be received when the user is offline
◆ V2TIM_GROUP_MESSAGE_READ_MEMBERS_FILTER_READ
final int V2TIM_GROUP_MESSAGE_READ_MEMBERS_FILTER_READ = 0 |
|
static |
Group message read member list
◆ V2TIM_GROUP_MESSAGE_READ_MEMBERS_FILTER_UNREAD
final int V2TIM_GROUP_MESSAGE_READ_MEMBERS_FILTER_UNREAD = 1 |
|
static |
Group message unread member list