Chat SDK for Unity and Windows v1.3.0
|
Public Member Functions | |
void | SetRoomMessagePriority (RoomMessagePriority priority) |
List< MessageReaction > | ReactionList () |
Message (IMessageBody body=null) | |
Static Public Member Functions | |
static Message | CreateReceiveMessage () |
static Message | CreateSendMessage (string to, IMessageBody body, MessageDirection direction=MessageDirection.SEND, bool hasRead=true) |
static Message | CreateTextSendMessage (string userId, string content) |
static Message | CreateFileSendMessage (string userId, string localPath, string displayName="", long fileSize=0) |
static Message | CreateImageSendMessage (string userId, string localPath, string displayName="", long fileSize=0, bool original=false, double width=0, double height=0) |
static Message | CreateVideoSendMessage (string userId, string localPath, string displayName="", string thumbnailLocalPath="", long fileSize=0, int duration=0, double width=0, double height=0) |
static Message | CreateVoiceSendMessage (string userId, string localPath, string displayName="", long fileSize=0, int duration=0) |
static Message | CreateLocationSendMessage (string userId, double latitude, double longitude, string address="", string buildingName="") |
static Message | CreateCmdSendMessage (string userId, string action, bool deliverOnlineOnly=false) |
static Message | CreateCustomSendMessage (string userId, string customEvent, Dictionary< string, string > customParams=null) |
static Message | CreateCombineSendMessage (string userId, string title, string summary, string compatibleText, List< string > messageList) |
static AttributeValueType | GetAttributeValueType (AttributeValue value) |
static void | SetAttribute (Dictionary< string, AttributeValue > arriMap, string key, in object value, AttributeValueType type) |
static T | GetAttributeValue< T > (AttributeValue value, out bool found) |
static T | GetAttributeValue< T > (Dictionary< string, AttributeValue > arriMap, string key, out bool found) |
Public Attributes | |
string | MsgId = ((long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds) + Tools.GetRandom()).ToString() |
string | ConversationId = "" |
string | From = "" |
string | To = "" |
MessageType | MessageType |
bool | DeliverOnlineOnly = false |
MessageDirection | Direction |
MessageStatus | Status |
long | LocalTime = (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds) |
long | ServerTime = 0 |
bool | HasDeliverAck = false |
bool | HasReadAck = false |
bool | IsNeedGroupAck = false |
bool | IsRead = false |
bool | MessageOnlineState = false |
IMessageBody | Body |
Dictionary< string, AttributeValue > | Attributes |
bool | IsThread = false |
bool | Broadcast = false |
bool | IsContentReplaced = false |
Properties | |
int | GroupAckCount [get] |
PinnedInfo | PinnedInfo [get] |
List< string > | ReceiverList [get, set] |
ChatThread | ChatThread [get] |
void AgoraChat.Message.SetRoomMessagePriority | ( | RoomMessagePriority | priority | ) |
Sets the priority of the chat room message.
List< MessageReaction > AgoraChat.Message.ReactionList | ( | ) |
Gets the list of Reactions.
|
static |
Creates a received message instance.
|
static |
Creates a message instance for sending.
to | The message recipient: |
body | The message body. |
direction | The message direction, that is, whether the message is received or sent. This parameter is set to SEND .
|
hasRead | Whether a read receipt is required.
|
|
static |
|
static |
|
static |
Creates an image message for sending.
userId | The message recipient: |
localPath | The local path of the image. |
displayName | The display name of the image. |
fileSize | The image size in bytes. |
original | Whether to send the original image.
|
width | The image width in pixels. |
heigh | The image height in pixels. |
|
static |
Creates a video message for sending.
userId | The message recipient: |
localPath | The URI of the video file. |
displayName | The display name of the video file. |
thumbnailLocalPath | The local path of the thumbnail of the video file. |
fileSize | The size of the video file, in bytes. |
duration | The video duration in seconds. |
width | The video width in pixels. |
heigh | The video height in pixels. |
|
static |
Creates a voice message for sending.
userId | The message recipient: |
localPath | The local path of the voice file. |
displayName | The display name of f the voice file. |
fileSize | The size of the voice file, in bytes. |
duration | The voice duration in seconds. |
|
static |
|
static |
Creates a command message for sending.
userId | The message recipient: |
action | The command action. |
deliverOnlineOnly | Whether this command message is delivered only to the online users.
|
|
static |
|
static |
Creates a combined message for sending.
userId | The message recipient: |
title | The title of the combined message. It can be null or an empty string (""). |
summary | The summary of the combined message. It can be null or an empty string (""). |
compatibleText | The compatible text of the combined message. It can be null or an empty string (""). |
messageList | The ID list of messages included in the combined message. The list cannot be null or empty. It can contain a maximum of 300 message IDs. |
|
static |
Gets the type of the message extension attribute.
value | The extension attribute instance. |
|
static |
Sets an extension attribute.
arriMap | The dictionary to which the new extension attribute will be added. |
key | The keyword of the extension attribute. |
type | The type of the extension attribute. |
value | The value of the extension attribute. |
|
static |
Gets the data of the generic <T> type of an extension attribute.
value | The value of the extension attribute. |
found | Whether the data of the generic <T> type is included in the value of the extension attribute. |
found
is true
, the data of the generic <T> type is returned.found
is false
, null
is returned.
|
static |
Gets the data of the generic <T> type of an extension attribute from the extension attribute dictionary.
arriMap | The dictionary which contains attributes. |
key | The keyword in the dictionary for the extension attribute. |
found | Whether the data of the generic <T> type is included in the value of the extension attribute. |
found
is true
, the data of the generic <T> type is returned.found
is false
, null
is returned. string AgoraChat.Message.MsgId = ((long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds) + Tools.GetRandom()).ToString() |
The message ID.
string AgoraChat.Message.ConversationId = "" |
The ID of the conversation to which the message belongs.
string AgoraChat.Message.From = "" |
The user ID of the message sender.
string AgoraChat.Message.To = "" |
The message recipient.
MessageType AgoraChat.Message.MessageType |
bool AgoraChat.Message.DeliverOnlineOnly = false |
Whether the message is delivered only when the recipient(s) is/are online:
true
:The message is delivered only when the recipient(s) is/are online. If the recipient is offline, the message is discarded.false
:The message is delivered when the recipient(s) is/are online. If the recipient(s) is/are offline, the message will not be delivered to them until they get online. MessageDirection AgoraChat.Message.Direction |
The message direction, that is, whether the message is received or sent.
SEND
: This message is sent from the local client.RECEIVE
: The message is received by the local client.See Direct
.
MessageStatus AgoraChat.Message.Status |
The message status, which can be one of the following:
CREATE
:The message is created.PROGRESS
:The message is being delivered.SUCCESS
:The message is successfully delivered.FAIL
:The message fails to be delivered. long AgoraChat.Message.LocalTime = (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds) |
The local Unix timestamp for creating the message. The unit is millisecond.
long AgoraChat.Message.ServerTime = 0 |
The Unix timestamp when the message is received by the server. The unit is millisecond.
bool AgoraChat.Message.HasDeliverAck = false |
Whether the message is delivered.
true
: Yes.false
: No. bool AgoraChat.Message.HasReadAck = false |
Whether the message is read.
-true
: Yes. -false
: No.
bool AgoraChat.Message.IsNeedGroupAck = false |
Whether read receipts are required for group messages.
true
: Yes.false
: No. bool AgoraChat.Message.IsRead = false |
Whether the message is read or not.
Conversation#MarkAllMessagesAsRead()
in a conversation. bool AgoraChat.Message.MessageOnlineState = false |
Whether the message is an online message.
true
: Yes.false
: No. IMessageBody AgoraChat.Message.Body |
The message body.
Dictionary<string, AttributeValue> AgoraChat.Message.Attributes |
The message extension.
bool AgoraChat.Message.IsThread = false |
Whether the message is in a message thread:
true
: Yes.false
: No.This property is read only.
bool AgoraChat.Message.Broadcast = false |
Whether it is a global broadcast message for all chat rooms in an app:
true
: Yes.false
: No.This property is read only.
bool AgoraChat.Message.IsContentReplaced = false |
Whether the content of message is replaced:
true
: Yes.false
: No.This property is read only.
|
get |
Gets the number of read receipts for a group message.
|
get |
Gets the message pinning information.
|
getset |
The recipient list of a targeted message.
This property is used only for messages in groups and chat rooms.
|
get |
Gets the overview of the message thread.
The overview of the message thread exists only after you create a message thread.