hx-websdk
Version:
Easemob IM websdk
3,688 lines (982 loc) • 190 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>connection - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="connection.html">connection</a><ul class='methods'><li data-type='method'><a href="connection.html#acceptInviteFromGroup">acceptInviteFromGroup</a></li><li data-type='method'><a href="connection.html#addGroupMembers">addGroupMembers</a></li><li data-type='method'><a href="connection.html#addRoster">addRoster</a></li><li data-type='method'><a href="connection.html#addToBlackList">addToBlackList</a></li><li data-type='method'><a href="connection.html#addToGroupBlackList">addToGroupBlackList</a></li><li data-type='method'><a href="connection.html#agreeJoinGroup">agreeJoinGroup</a></li><li data-type='method'><a href="connection.html#blockGroup">blockGroup</a></li><li data-type='method'><a href="connection.html#changeGroupSubject">changeGroupSubject</a></li><li data-type='method'><a href="connection.html#close">close</a></li><li data-type='method'><a href="connection.html#createGroup">createGroup</a></li><li data-type='method'><a href="connection.html#createGroupAsync">createGroupAsync</a></li><li data-type='method'><a href="connection.html#createGroupNew">createGroupNew</a></li><li data-type='method'><a href="connection.html#destroyGroup">destroyGroup</a></li><li data-type='method'><a href="connection.html#dissolveGroup">dissolveGroup</a></li><li data-type='method'><a href="connection.html#event:unsubscribed">event:unsubscribed</a></li><li data-type='method'><a href="connection.html#getBlacklist">getBlacklist</a></li><li data-type='method'><a href="connection.html#getChatRooms">getChatRooms</a></li><li data-type='method'><a href="connection.html#getGroup">getGroup</a></li><li data-type='method'><a href="connection.html#getGroupAdmin">getGroupAdmin</a></li><li data-type='method'><a href="connection.html#getGroupBlacklist">getGroupBlacklist</a></li><li data-type='method'><a href="connection.html#getGroupBlacklistNew">getGroupBlacklistNew</a></li><li data-type='method'><a href="connection.html#getGroupInfo">getGroupInfo</a></li><li data-type='method'><a href="connection.html#getMuted">getMuted</a></li><li data-type='method'><a href="connection.html#getRoster">getRoster</a></li><li data-type='method'><a href="connection.html#getUniqueId">getUniqueId</a></li><li data-type='method'><a href="connection.html#groupBlockMulti">groupBlockMulti</a></li><li data-type='method'><a href="connection.html#groupBlockSingle">groupBlockSingle</a></li><li data-type='method'><a href="connection.html#inviteToGroup">inviteToGroup</a></li><li data-type='method'><a href="connection.html#joinChatRoom">joinChatRoom</a></li><li data-type='method'><a href="connection.html#joinGroup">joinGroup</a></li><li data-type='method'><a href="connection.html#joinPublicGroup">joinPublicGroup</a></li><li data-type='method'><a href="connection.html#leaveGroup">leaveGroup</a></li><li data-type='method'><a href="connection.html#leaveGroupBySelf">leaveGroupBySelf</a></li><li data-type='method'><a href="connection.html#listen">listen</a></li><li data-type='method'><a href="connection.html#listGroupMember">listGroupMember</a></li><li data-type='method'><a href="connection.html#listGroups">listGroups</a></li><li data-type='method'><a href="connection.html#listRooms">listRooms</a></li><li data-type='method'><a href="connection.html#modifyGroup">modifyGroup</a></li><li data-type='method'><a href="connection.html#mute">mute</a></li><li data-type='method'><a href="connection.html#open">open</a></li><li data-type='method'><a href="connection.html#queryRoomInfo">queryRoomInfo</a></li><li data-type='method'><a href="connection.html#queryRoomMember">queryRoomMember</a></li><li data-type='method'><a href="connection.html#queryRoomOccupants">queryRoomOccupants</a></li><li data-type='method'><a href="connection.html#quitChatRoom">quitChatRoom</a></li><li data-type='method'><a href="connection.html#quitGroup">quitGroup</a></li><li data-type='method'><a href="connection.html#registerUser">registerUser</a></li><li data-type='method'><a href="connection.html#rejectInviteFromGroup">rejectInviteFromGroup</a></li><li data-type='method'><a href="connection.html#rejectJoinGroup">rejectJoinGroup</a></li><li data-type='method'><a href="connection.html#removeAdmin">removeAdmin</a></li><li data-type='method'><a href="connection.html#removeFromBlackList">removeFromBlackList</a></li><li data-type='method'><a href="connection.html#removeGroupBlockMulti">removeGroupBlockMulti</a></li><li data-type='method'><a href="connection.html#removeGroupBlockSingle">removeGroupBlockSingle</a></li><li data-type='method'><a href="connection.html#removeGroupMemberFromBlacklist">removeGroupMemberFromBlacklist</a></li><li data-type='method'><a href="connection.html#removeMultiGroupMember">removeMultiGroupMember</a></li><li data-type='method'><a href="connection.html#removeMute">removeMute</a></li><li data-type='method'><a href="connection.html#removeRoster">removeRoster</a></li><li data-type='method'><a href="connection.html#removeSingleGroupMember">removeSingleGroupMember</a></li><li data-type='method'><a href="connection.html#send">send</a></li><li data-type='method'><a href="connection.html#setAdmin">setAdmin</a></li><li data-type='method'><a href="connection.html#subscribe">subscribe</a></li><li data-type='method'><a href="connection.html#subscribed">subscribed</a></li><li data-type='method'><a href="connection.html#unsubscribe">unsubscribe</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">connection</h1>
<section>
<header>
<h2>
connection
</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="connection"><span class="type-signature"></span>new connection<span class="signature">(options)</span><span class="type-signature"> → {Class}</span></h4>
<dl class="details">
</dl>
<div class="description">
The connection class.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">创建连接的初始化参数
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">xmpp服务器的URL</td>
</tr>
<tr>
<td class="name"><code>apiUrl</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">API服务器的URL</td>
</tr>
<tr>
<td class="name"><code>isHttpDNS</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">防止域名劫持</td>
</tr>
<tr>
<td class="name"><code>isMultiLoginSessions</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">为true时同一账户可以同时在多个Web页面登录(多标签登录,默认不开启,如有需要请联系商务),为false时同一账号只能在一个Web页面登录</td>
</tr>
<tr>
<td class="name"><code>https</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">是否启用wss.</td>
</tr>
<tr>
<td class="name"><code>heartBeatWait</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">发送心跳包的时间间隔(毫秒)</td>
</tr>
<tr>
<td class="name"><code>isAutoLogin</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">登录成功后是否自动出席</td>
</tr>
<tr>
<td class="name"><code>autoReconnectNumMax</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">掉线后重连的最大次数</td>
</tr>
<tr>
<td class="name"><code>autoReconnectInterval</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">掉线后重连的间隔时间(毫秒)</td>
</tr>
<tr>
<td class="name"><code>isWindowSDK</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">是否运行在WindowsSDK上</td>
</tr>
<tr>
<td class="name"><code>encrypt</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">是否加密文本消息</td>
</tr>
<tr>
<td class="name"><code>delivery</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">是否发送delivered ack</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
连接实例
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Class</span>
</dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="acceptInviteFromGroup"><span class="type-signature"></span>acceptInviteFromGroup<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
接受加入申请(已废弃)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>list</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">列表,默认[]</td>
</tr>
<tr>
<td class="name"><code>roomId</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">聊天室id</td>
</tr>
<tr>
<td class="name"><code>reason</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">原因</td>
</tr>
<tr>
<td class="name"><code>success</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">成功之后的回调,默认为空</td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">失败之后的回调,默认为空</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="addGroupMembers"><span class="type-signature"></span>addGroupMembers<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
添加群组成员(已废弃)
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>Attention the sequence: message first (每个成员单独发一条message), iq second (多个成员可以合成一条iq发)
<!-- 添加成员通知:send -->
<message to='easemob-demo#chatdemoui_1477482739698@conference.easemob.com'>
<x xmlns='http://jabber.org/protocol/muc#user'>
<invite to='easemob-demo#chatdemoui_lwz2@easemob.com'>
<reason>liuwz invite you to join group '谢谢'</reason>
</invite>
</x>
</message>
<!-- 添加成员:send -->
<iq id='09DFB1E5-C939-4C43-B5A7-8000DA0E3B73_easemob_occupants_change_affiliation' to='easemob-demo#chatdemoui_1477482739698@conference.easemob.com' type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='member' jid='easemob-demo#chatdemoui_lwz2@easemob.com'/>
</query>
</iq></code></pre>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>list</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">字符串数组,成员列表。[id1,id2,id3]</td>
</tr>
<tr>
<td class="name"><code>roomId</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">群组id</td>
</tr>
<tr>
<td class="name"><code>success</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">成功回调</td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">失败回调</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="addRoster"><span class="type-signature"></span>addRoster<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
添加联系人(已废弃)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h4 class="name" id="addToBlackList"><span class="type-signature"></span>addToBlackList<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
将好友加入到黑名单
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>list</code></td>
<td class="type">
<span class="param-type">Array.<Object></span>
</td>
<td class="description last">json数组,调用这个函数后黑名单的所有名单列表(已经存在的黑名单加上这次新加黑名单),json的key值为好友的ID,value为之前获取的整个好友对象即可</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">要加到黑名单的好友对象的type,默认是"jid"</td>
</tr>
<tr>
<td class="name"><code>list[].order</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">要加到黑名单的好友对象的order,所有order不重复,可不填</td>
</tr>
<tr>
<td class="name"><code>list[].jid</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">要加到黑名单的好友的jid</td>
</tr>
<tr>
<td class="name"><code>list[].name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">要加到黑名单的好友的ID</td>
</tr>
<tr>
<td class="name"><code>success</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">成功之后的回调,默认为空</td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">失败之后的回调,默认为空</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="addToGroupBlackList"><span class="type-signature"></span>addToGroupBlackList<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
加入群组黑名单(已废弃)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h4 class="name" id="agreeJoinGroup"><span class="type-signature"></span>agreeJoinGroup<span class="signature">(opt)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
通过RestFul API同意用户加入群
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>opt</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>applicant</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">申请加群的用户ID</td>
</tr>
<tr>
<td class="name"><code>groupId</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">群组ID</td>
</tr>
<tr>
<td class="name"><code>success</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">成功之后的回调,默认为空</td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">失败之后的回调,默认为空</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="blockGroup"><span class="type-signature"></span>blockGroup<span class="signature">(opt)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>1.4.11</li></ul></dd>
</dl>
<div class="description">
通过RestFul API屏蔽群组,只对移动端有效
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>opt</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>groupId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">需要屏蔽的群组ID</td>
</tr>
<tr>
<td class="name"><code>success</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">成功之后的回调,默认为空</td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">失败之后的回调,默认为空</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="changeGroupSubject"><span class="type-signature"></span>changeGroupSubject<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
修改群名称(已废弃)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h4 class="name" id="close"><span class="type-signature"></span>close<span class="signature">(reason)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
断开连接,同时心跳停止
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>reason</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">断开原因</td>
</tr>
</tbody>
</table>
<h4 class="name" id="createGroup"><span class="type-signature"></span>createGroup<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
创建群组(已废弃)
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>1. 创建申请 -> 得到房主身份
2. 获取房主信息 -> 得到房间form
3. 完善房间form -> 创建成功
4. 添加房间成员
5. 消息通知成员</code></pre>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-</td>
</tr>
</tbody>
</table>
<h4 class="name" id="createGroupAsync"><span class="type-signature"></span>createGroupAsync<span class="signature">(p)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
创建群组-异步(已废弃)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>p</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-</td>
</tr>
</tbody>
</table>
<h4 class="name" id="createGroupNew"><span class="type-signature"></span>createGroupNew<span class="signature">(opt)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>1.4.11</li></ul></dd>
</dl>
<div class="description">
通过RestFul API接口创建群组
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>opt</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">群组信息
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>groupname</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">群组名</td>
</tr>
<tr>
<td class="name"><code>desc</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">群组描述</td>
</tr>
<tr>
<td class="name"><code>members</code></td>
<td class="type">
<span class="param-type">Array.<string></span>
</td>
<td class="description last">好友id数组,群好友列表</td>
</tr>
<tr>
<td class="name"><code>public</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">true: 公开群,false: 私有群</td>
</tr>
<tr>
<td class="name"><code>approval</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">前提:opt.data.public=true, true: 加群需要审批,false: 加群无需审批</td>
</tr>
<tr>
<td class="name"><code>allowinvites</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">前提:opt.data.public=false, true: 允许成员邀请入群,false: 不允许成员邀请入群</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>success</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">成功之后的回调,默认为空</td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">失败之后的回调,默认为空</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="destroyGroup"><span class="type-signature"></span>destroyGroup<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd>
</dl>
<div class="description">
删除群组(已废弃)
</div>
<h5>Example</h5>
<pre class="prettyprint"><code><iq id="9BEF5D20-841A-4048-B33A-F3F871120E58" to="easemob-demo#chatdemoui_1477462231499@conference.easemob.com" type="set">
<query xmlns="http://jabber.org/protocol/muc#owner">
<destroy>
<reason>xxx destory group yyy</reason>
</destroy>
</query>
</iq></code></pre>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-</td>
</tr>
</tbody>
</table>
<h4 class="name" id="dissolveGroup"><span class="type-signature"></span>dissolveGroup<span class="signature">(opt)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
通过RestFul API解散群组
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>opt</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>groupId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">群组ID</td>
</tr>
<tr>
<td class="name"><code>success</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">成功之后的回调,默认为空</td>
</tr>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">失败之后的回调,默认为空</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="event:unsubscribed"><span class="type-signature"></span>event:unsubscribed<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
拒绝对方的订阅请求
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">-
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>to</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">订阅人的ID</td>
</tr>
<tr>
<td class="name"><code>message</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">发送给拒绝订阅的联系人的验证消息(非必须)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id="getBlacklist"><span class="type-signature"></span>getBlacklist<span class="signature">(options)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
获取好友黑名单
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last