Chat SDK for Unity and Windows v1.2.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 |
Properties | |
int | GroupAckCount [get] |
List< string > | ReceiverList [get, set] |
ChatThread | ChatThread [get] |
void AgoraChat.Message.SetRoomMessagePriority | ( | RoomMessagePriority | priority | ) |
Sets the priority of chat room messages.
List< MessageReaction > AgoraChat.Message.ReactionList | ( | ) |
Get the list of Reactions.
|
static |
Creates a received message instance.
|
static |
Creates a message instance for sending.
to | The user ID of 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 |
Creates a text message for sending.
userId | The user ID of the message recipient, group ID, thread ID, or chatroom ID. |
content | The text content. |
|
static |
Creates a file message for sending.
userId | The user ID of the message recipient, group ID, thread ID, or chatroom ID. |
localPath | The local path of the file. |
displayName | The display name of the file. |
fileSize | The file size in bytes. |
|
static |
Creates an image message for sending.
userId | The user ID of the message recipient, group ID, thread ID, or chatroom ID. |
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 user ID of the message recipient, group ID, thread ID, or chatroom ID. |
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 user ID of the message recipient, group ID, thread ID, or chatroom ID. |
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 |
Creates a location message for sending.
userId | The user ID of the message recipient, group ID, thread ID, or chatroom ID. |
latitude | The latitude. |
longitude | The longitude. |
address | The location details. |
buildingName | The building name. |
|
static |
Creates a command message for sending.
userId | The user ID of the message recipient, group ID, thread ID, or chatroom ID. |
action | The command action. |
deliverOnlineOnly | Whether this command message is delivered only to the online users.
|
|
static |
Creates a custom message for sending.
userId | The user ID of the message recipient, group ID, thread ID, or chatroom ID. |
customEvent | The custom event. |
customParams | The dictionary of custom parameters. |
|
static |
Creates an image message for sending.
userId | The user ID of the message recipient, group ID, thread ID, or chatroom ID. |
title | The title of combined message. |
summary | The summary of combined message. |
messageList | The message Id list included in combined message. |
|
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 user ID of the message recipient or the group ID.
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 |
Sets whether read receipts are required for group messages.
need | - true : Yes.
|
bool AgoraChat.Message.IsRead = false |
Check 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 thread:
true
: Yes.false
: No.
|
get |
Gets the number of read receipts for a group message.
|
getset |
The list of IDs of group or chat room members that receive a message.
|
get |
Gets the overview of the message thread.
The overview of the message thread exists only after you creates a message thread.