|
Chat SDK for Unity and Windows v1.3.2
|
Public 成员函数 | |
| void | SetRoomMessagePriority (RoomMessagePriority priority) |
| List< MessageReaction > | ReactionList () |
| Message (IMessageBody body=null) | |
静态 Public 成员函数 | |
| 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 属性 | |
| 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 |
属性 | |
| int | GroupAckCount [get] |
| PinnedInfo | PinnedInfo [get] |
| List< string > | ReceiverList [get, set] |
| ChatThread | ChatThread [get] |
| void AgoraChat.Message.SetRoomMessagePriority | ( | RoomMessagePriority | priority | ) |
设置聊天室消息优先级。
| List< MessageReaction > AgoraChat.Message.ReactionList | ( | ) |
获取 Reaction 列表。
|
static |
创建一条接收的消息。
|
static |
创建一条发送的消息。
| to | 消息接收方。
|
| body | 消息体。 |
| direction | 消息方向,设置为 SEND。
|
| hasRead | 是否需要已读回执。 |
|
static |
创建一条文本发送消息。
| userId | 消息接收方。
|
| content | 文本内容。 |
|
static |
创建一条文件发送消息。
| userId | 消息接收方。
|
| localPath | 文件的本地路径。 |
| displayName | 文件的显示名称。 |
| fileSize | 文件大小,单位为字节。 |
|
static |
创建一条图片发送消息。
| userId | 消息接收方。
|
| localPath | 图片的本地路径。 |
| displayName | 图片的显示名称。 |
| fileSize | 图片大小,单位为字节。 |
| original | 是否发送原图。
|
| width | 图片宽度,单位为像素。 |
| heigh | 图片高度,单位为像素。 |
|
static |
创建一条视频发送消息。
| userId | 消息接收方。
|
| localPath | 视频文件的 URI。 |
| displayName | 视频文件的显示名称。 |
| thumbnailLocalPath | 缩略图的本地路径。 |
| fileSize | 视频文件的大小,单位为字节。 |
| duration | 视频时间长度,单位为秒。 |
| width | 视频宽度,单位为像素。 |
| heigh | 视频高度,单位为像素。 |
|
static |
创建一条语音发送消息。
| userId | 消息接收方。
|
| localPath | 语音文件的本地路径。 |
| displayName | 语音文件的显示名称。 |
| fileSize | 语音文件的大小,单位为字节。 |
| duration | 语音时间长度,单位为秒。 |
|
static |
创建一条位置发送消息。
| userId | 消息接收方。
|
| latitude | 纬度。 |
| longitude | 经度。 |
| address | 位置详情。 |
| buildingName | 建筑物名称。 |
|
static |
创建一条命令发送消息。
| userId | 消息接收方。
|
| action | 命令内容。
|
|
static |
创建一条自定义发送消息。
| userId | 消息接收方。
|
| customEvent | 自定义事件。 |
| customParams | 自定义参数字典。 |
|
static |
创建一条合并消息的发送消息。
| userId | 消息接收方。
|
| title | 合并消息的标题。该字段可以设置为 null 或者空字符串。 |
| summary | 合并消息的概要。该字段可以设置为 null 或者空字符串。 |
| compatibleText | 合并消息的兼容信息。该字段可以设置为 null 或者空字符串。该字段用于需要兼容不支持合并转发消息的版本。 |
| messageList | 合并消息的消息 ID 列表。列表不可为null或者空,最多可包含 300 个消息 ID。 |
|
static |
获取扩展属性的类型。
| value | 扩展属性实例。 |
|
static |
设置单个扩展属性。
| arriMap | 要新增扩展属性的字典。 |
| key | 新增扩展属性的关键字。 |
| type | 扩展属性的类型。 |
| value | 扩展属性的值。 |
|
static |
获取单个扩展属性的泛型类型 T 的数据。
| value | 扩展属性的值。 |
| found | 扩展属性的值中是否包含泛型类型 T 的数据。 |
found 为 true 时,返回泛型类型 T 的数据found 为 false 时,返回 null。
|
static |
从扩展属性字典中获取单个扩展属性的泛型类型 T 的数据。
| arriMap | 扩展属性字典。 |
| key | 扩展属性在字典中的关键字。 |
| found | 扩展属性的值中是否包含泛型类型 T 的数据。 |
found 为 true 时,返回泛型类型 T 的数据found 为 false 时,返回 null。 | string AgoraChat.Message.MsgId = ((long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds) + Tools.GetRandom()).ToString() |
消息的 ID。
| string AgoraChat.Message.ConversationId = "" |
消息所属会话的 ID。
| string AgoraChat.Message.From = "" |
消息发送者的用户 ID。
| string AgoraChat.Message.To = "" |
消息接收方,可以是:
| MessageType AgoraChat.Message.MessageType |
| bool AgoraChat.Message.DeliverOnlineOnly = false |
消息是否只投递给在线用户:
true:只有消息接收方在线时才能投递成功。若接收方离线,则消息会被丢弃。false:如果用户在线,则直接投递;如果用户离线,消息会在用户上线时投递。 | MessageDirection AgoraChat.Message.Direction |
| MessageStatus AgoraChat.Message.Status |
消息的状态,包含以下状态:
CREATE:消息已创建;PROGRESS:消息正在发送;SUCCESS:消息成功发送;FAIL:消息发送失败。 | long AgoraChat.Message.LocalTime = (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds) |
消息的本地创建 Unix 时间戳,单位为毫秒。
| long AgoraChat.Message.ServerTime = 0 |
消息的服务器接收的 Unix 时间戳,单位为毫秒。
| bool AgoraChat.Message.HasDeliverAck = false |
消息是否已送达对方。
true: 已送达;false: 未送达。 | bool AgoraChat.Message.HasReadAck = false |
消息是否已读。
true: 已读;false: 未读。 | bool AgoraChat.Message.IsNeedGroupAck = false |
群组消息是否需要已读回执。
true:需要;false:不需要。 | bool AgoraChat.Message.IsRead = false |
消息是否已读。
IConversation#MarkAllMessageAsRead()。 | bool AgoraChat.Message.MessageOnlineState = false |
是否为在线消息。
true:是。false:否。 | IMessageBody AgoraChat.Message.Body |
消息体。
| Dictionary<string, AttributeValue> AgoraChat.Message.Attributes |
消息扩展。
| bool AgoraChat.Message.IsThread = false |
是否是 Thread 消息:
true:是;false:否。该属性为只读属性。
| bool AgoraChat.Message.Broadcast = false |
是否是聊天室全局广播消息:
true:是;false:否。该属性为只读属性。
| bool AgoraChat.Message.IsContentReplaced = false |
内容是否被替换:
true:是;false:否。该属性为只读属性。
|
get |
获取群组消息的已读回执数。
|
get |
获取当前消息的置顶信息。
|
getset |
定向消息的接收方。
该属性仅对群组聊天和聊天室中的消息有效。
|
get |
获取子区概览信息。
子区概览信息仅在创建子区后携带。