|
Chat SDK for Unity and Windows v1.3.2
|
Public 成员函数 | |
| void | AddContact (string userId, string reason=null, CallBack callback=null) |
| void | DeleteContact (string userId, bool keepConversation=false, CallBack callback=null) |
| void | GetAllContactsFromServer (ValueCallBack< List< string > > callback=null) |
| List< string > | GetAllContactsFromDB () |
| void | AddUserToBlockList (string userId, CallBack callback=null) |
| void | RemoveUserFromBlockList (string userId, CallBack callback=null) |
| void | GetBlockListFromServer (ValueCallBack< List< string > > callback=null) |
| List< string > | GetBlockListFromDB () |
| void | AcceptInvitation (string userId, CallBack callback=null) |
| void | DeclineInvitation (string userId, CallBack callback=null) |
| void | GetSelfIdsOnOtherPlatform (ValueCallBack< List< string > > callback=null) |
| void | SetContactRemark (string userId, string remark, CallBack callback=null) |
| Contact | FetchContactFromLocal (string userId) |
| void | FetchAllContactsFromLocal (ValueCallBack< List< Contact > > callback=null) |
| void | FetchAllContactsFromServer (ValueCallBack< List< Contact > > callback=null) |
| void | FetchAllContactsFromServerByPage (int limit=20, string cursor=null, ValueCallBack< CursorResult< Contact > > callback=null) |
| void | AddContactManagerDelegate (IContactManagerDelegate contactManagerDelegate) |
| void | RemoveContactManagerDelegate (IContactManagerDelegate contactManagerDelegate) |
联系人管理类,用于添加、查询和删除联系人。
| void AgoraChat.ContactManager.AddContact | ( | string | userId, |
| string | reason = null, |
||
| CallBack | callback = null |
||
| ) |
添加好友。
异步方法。
| userId | 要添加为好友的用户 ID。 |
| reason | 添加好友的原因,即邀请消息。该参数可选,可设置为 null 或 ""。 |
| callback | 结果回调,详见 CallBack。 |
| void AgoraChat.ContactManager.DeleteContact | ( | string | userId, |
| bool | keepConversation = false, |
||
| CallBack | callback = null |
||
| ) |
删除联系人及其相关的会话。
异步方法。
| userId | 要删除的联系人的用户 ID。 |
| keepConversation | 是否保留要删除的联系人的会话。
|
| callback | 结果回调,详见 CallBack。 |
| void AgoraChat.ContactManager.GetAllContactsFromServer | ( | ValueCallBack< List< string > > | callback = null | ) |
| List< string > AgoraChat.ContactManager.GetAllContactsFromDB | ( | ) |
从本地数据库获取联系人列表。
| void AgoraChat.ContactManager.AddUserToBlockList | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
| void AgoraChat.ContactManager.RemoveUserFromBlockList | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
| void AgoraChat.ContactManager.GetBlockListFromServer | ( | ValueCallBack< List< string > > | callback = null | ) |
| List< string > AgoraChat.ContactManager.GetBlockListFromDB | ( | ) |
从本地获取黑名单列表。
| void AgoraChat.ContactManager.AcceptInvitation | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
| void AgoraChat.ContactManager.DeclineInvitation | ( | string | userId, |
| CallBack | callback = null |
||
| ) |
| void AgoraChat.ContactManager.GetSelfIdsOnOtherPlatform | ( | ValueCallBack< List< string > > | callback = null | ) |
获取登录用户在其他登录设备上唯一 ID。
该 ID 由 user ID + "/" + resource 组成。
异步方法。
| callback | 该方法完成的回调。调用成功会返回用户在其他登录设备上的 ID;失败则返回错误信息。详见 ValueCallBack |
| void AgoraChat.ContactManager.SetContactRemark | ( | string | userId, |
| string | remark, | ||
| CallBack | callback = null |
||
| ) |
| Contact AgoraChat.ContactManager.FetchContactFromLocal | ( | string | userId | ) |
| void AgoraChat.ContactManager.FetchAllContactsFromLocal | ( | ValueCallBack< List< Contact > > | callback = null | ) |
| void AgoraChat.ContactManager.FetchAllContactsFromServer | ( | ValueCallBack< List< Contact > > | callback = null | ) |
| void AgoraChat.ContactManager.FetchAllContactsFromServerByPage | ( | int | limit = 20, |
| string | cursor = null, |
||
| ValueCallBack< CursorResult< Contact > > | callback = null |
||
| ) |
从服务器分页获取所有联系人信息。
异步方法。
| limit | 每页期望获取的联系人条数。取值范围为 [1,50]。 |
| cursor | 查询的起始游标位置。 |
| callback | 结果回调,详见 ValueCallBack。 |
| void AgoraChat.ContactManager.AddContactManagerDelegate | ( | IContactManagerDelegate | contactManagerDelegate | ) |
注册联系人监听器。
| contactManagerDelegate | 要注册的联系人监听器,继承自 IContactManagerDelegate。 |
| void AgoraChat.ContactManager.RemoveContactManagerDelegate | ( | IContactManagerDelegate | contactManagerDelegate | ) |
移除联系人监听器。
| contactManagerDelegate | 要移除的联系人监听器,继承自 IContactManagerDelegate。 |