PHPSDK
Public 成员函数 | 所有成员列表
Easemob\Contact类 参考

Public 成员函数

 add ($username, $contact)
 添加好友 更多...
 
 remove ($username, $contact)
 移除好友 更多...
 
 get ($username)
 获取好友列表 更多...
 

详细描述

Contact 用来管理联系人(添加好友等)

成员函数说明

◆ add()

Easemob\Contact::add (   $username,
  $contact 
)

添加好友

好友必须是和自己在一个 App Key 下的用户。免费版 App Key 下的每个用户的好友数量上限为 1000,不同版本 App Key 上限不同,具体可参考:版本功能介绍

参数
string$username要添加好友的用户名
string$contact好友用户名
返回
boolean|array 成功或者错误

◆ get()

Easemob\Contact::get (   $username)

获取好友列表

参数
string$username要获取好友列表的用户名
返回
array 好友列表或者错误

◆ remove()

Easemob\Contact::remove (   $username,
  $contact 
)

移除好友

从用户的好友列表中移除一个用户。

参数
string$username要移除好友的用户名
string$contact好友用户名
返回
boolean|array 成功或者错误