IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMSendMessageOption

Detailed Description

Options for sending an advanced message.

Public Member Functions

int getPriority ()
 
void setPriority (int priority)
 
boolean isOnlineUserOnly ()
 
void setOnlineUserOnly (boolean onlineUserOnly)
 
V2TIMPushInfo getPushInfo ()
 
void setPushInfo (V2TIMPushInfo pushInfo)
 

Member Function Documentation

◆ getPriority()

int getPriority ( )
inline

Get the message priority.

◆ setPriority()

void setPriority ( int  priority)
inline

Set the message priority. This field is valid only for group chat messages. Default: V2TIMMessage.V2TIM_PRIORITY_DEFAULT.

Attention
You are advised to set higher priorities for important messages (such as red packet and gift messages) and lower priorities for frequent but unimportant messages (such as like messages).
Parameters
priorityMessage priority. Valid values: V2TIMMessage.V2TIM_PRIORITY_DEFAULT, V2TIM_PRIORITY_HIGH, V2TIM_PRIORITY_NORMAL, V2TIM_PRIORITY_LOW

◆ isOnlineUserOnly()

boolean isOnlineUserOnly ( )
inline

Get whether the message can be received only by online users.

◆ setOnlineUserOnly()

void setOnlineUserOnly ( boolean  onlineUserOnly)
inline

Set whether the message can be received only by online users. Default: false.

If this field is set to true, the message will not appear in the recipient's historical message list. This field is often used to implement less important notifications such as typing indicators.

Attention
  • Audio-video groups (AVChatRoom) do not support this field. You need to set it to false for audio-video groups (AVChatRoom).
  • If this field is set to true, the message is an online message and is not counted as an unread message.

◆ getPushInfo()

V2TIMPushInfo getPushInfo ( )
inline

Get the offline push configuration.

◆ setPushInfo()

void setPushInfo ( V2TIMPushInfo  pushInfo)
inline

Set the offline push configuration. Default: null.

Attention
  • If null, offline push is disabled for this message.
  • If you want to push custom messages as well, set the desc field in pushInfo so that the information specified by desc will be displayed by default during push.