Unity and Windows API reference
Public 成员函数 | 所有成员列表
ChatSDK.IContactManager类 参考abstract

Public 成员函数

abstract void AddContact (string username, string reason=null, CallBack handle=null)
 
abstract void DeleteContact (string username, bool keepConversation=false, CallBack handle=null)
 
abstract void GetAllContactsFromServer (ValueCallBack< List< string > > handle=null)
 
abstract List< string > GetAllContactsFromDB ()
 
abstract void AddUserToBlockList (string username, CallBack handle=null)
 
abstract void RemoveUserFromBlockList (string username, CallBack handle=null)
 
abstract void GetBlockListFromServer (ValueCallBack< List< string > > handle=null)
 
abstract void AcceptInvitation (string username, CallBack handle=null)
 
abstract void DeclineInvitation (string username, CallBack handle=null)
 
abstract void GetSelfIdsOnOtherPlatform (ValueCallBack< List< string > > handle=null)
 
void AddContactManagerDelegate (IContactManagerDelegate contactManagerDelegate)
 
void RemoveContactManagerDelegate (IContactManagerDelegate contactManagerDelegate)
 

详细描述

联系人管理类,用于添加、查询和删除联系人。

成员函数说明

◆ AddContact()

abstract void ChatSDK.IContactManager.AddContact ( string  username,
string  reason = null,
CallBack  handle = null 
)
pure virtual

添加好友。

异步方法。

参数
username要添加为好友的用户 ID。
reason添加好友的原因,即邀请消息。该参数可选,可设置为 null 或 ""。
handle结果回调,详见 CallBack

◆ DeleteContact()

abstract void ChatSDK.IContactManager.DeleteContact ( string  username,
bool  keepConversation = false,
CallBack  handle = null 
)
pure virtual

删除联系人及其相关的会话。

异步方法。

参数
username要删除的联系人的用户 ID。
keepConversation是否保留要删除的联系人的会话。
  • true:是;
  • (默认)false:否。
handle结果回调,详见 CallBack

◆ GetAllContactsFromServer()

abstract void ChatSDK.IContactManager.GetAllContactsFromServer ( ValueCallBack< List< string > >  handle = null)
pure virtual

从服务器获取联系人列表。

异步方法。

参数
handle结果回调。成功则返回联系人列表,失败返回错误信息,详见 ValueCallBack

◆ GetAllContactsFromDB()

abstract List< string > ChatSDK.IContactManager.GetAllContactsFromDB ( )
pure virtual

从本地数据库获取联系人列表。

返回
调用成功会返回好友列表,失败返回空列表。

◆ AddUserToBlockList()

abstract void ChatSDK.IContactManager.AddUserToBlockList ( string  username,
CallBack  handle = null 
)
pure virtual

将指定用户加入黑名单。

你可以向黑名单中用户发消息,但是接收不到对方发送的消息。

异步方法。

参数
username要加入黑名单的用户的用户 ID。
handle结果回调,详见 CallBack

◆ RemoveUserFromBlockList()

abstract void ChatSDK.IContactManager.RemoveUserFromBlockList ( string  username,
CallBack  handle = null 
)
pure virtual

将指定用户移除黑名单。

异步方法。

参数
username要在黑名单中移除的用户 ID。
handle结果回调,详见 CallBack

◆ GetBlockListFromServer()

abstract void ChatSDK.IContactManager.GetBlockListFromServer ( ValueCallBack< List< string > >  handle = null)
pure virtual

从服务器获取黑名单列表。

异步方法。

参数
handle结果回调。调用成功则返回黑名单列表,失败返回错误信息。详见 ValueCallBack

◆ AcceptInvitation()

abstract void ChatSDK.IContactManager.AcceptInvitation ( string  username,
CallBack  handle = null 
)
pure virtual

接受加好友的邀请。

异步方法。

参数
username发起好友邀请的用户 ID。
handle结果回调,详见 CallBack

◆ DeclineInvitation()

abstract void ChatSDK.IContactManager.DeclineInvitation ( string  username,
CallBack  handle = null 
)
pure virtual

拒绝加好友的邀请。

异步方法。

参数
username发起好友邀请的用户 ID。
handle该方法完成的回调,详见 CallBack

◆ GetSelfIdsOnOtherPlatform()

abstract void ChatSDK.IContactManager.GetSelfIdsOnOtherPlatform ( ValueCallBack< List< string > >  handle = null)
pure virtual

获取登录用户在其他登录设备上唯一 ID。

该 ID 由 user ID + "/" + resource 组成。

异步方法。

参数
handle该方法完成的回调。调用成功会返回用户在其他登录设备上的 ID;失败则返回错误信息。详见 ValueCallBack

◆ AddContactManagerDelegate()

void ChatSDK.IContactManager.AddContactManagerDelegate ( IContactManagerDelegate  contactManagerDelegate)

注册联系人监听器。

参数
contactManagerDelegate要注册的联系人监听器,继承自 IContactManagerDelegate

◆ RemoveContactManagerDelegate()

void ChatSDK.IContactManager.RemoveContactManagerDelegate ( IContactManagerDelegate  contactManagerDelegate)

移除联系人监听器。

参数
contactManagerDelegate要移除的联系人监听器,继承自 IContactManagerDelegate