new connection(options) → {Class}
The connection class.
Parameters:
| Name |
Type |
Description |
options |
Object
|
创建连接的初始化参数
Properties
| Name |
Type |
Description |
url |
String
|
xmpp服务器的URL |
apiUrl |
String
|
API服务器的URL |
isHttpDNS |
Boolean
|
防止域名劫持 |
isMultiLoginSessions |
Boolean
|
为true时同一账户可以同时在多个Web页面登录(多标签登录,默认不开启,如有需要请联系商务),为false时同一账号只能在一个Web页面登录 |
https |
Boolean
|
是否启用wss. |
heartBeatWait |
Number
|
发送心跳包的时间间隔(毫秒) |
isAutoLogin |
Boolean
|
登录成功后是否自动出席 |
autoReconnectNumMax |
Number
|
掉线后重连的最大次数 |
autoReconnectInterval |
Number
|
掉线后重连的间隔时间(毫秒) |
isWindowSDK |
Boolean
|
是否运行在WindowsSDK上 |
encrypt |
Boolean
|
是否加密文本消息 |
delivery |
Boolean
|
是否发送delivered ack |
|
Returns:
连接实例
-
Type
-
Class
Methods
acceptInviteFromGroup(options)
- Deprecated:
接受加入申请(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
list |
Array
|
列表,默认[] |
roomId |
String
|
聊天室id |
reason |
String
|
原因 |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
addGroupMembers(options)
- Deprecated:
添加群组成员(已废弃)
Example
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>
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
list |
Object
|
字符串数组,成员列表。[id1,id2,id3] |
roomId |
Object
|
群组id |
success |
function
|
成功回调 |
error |
function
|
失败回调 |
|
addRoster(options)
- Deprecated:
添加联系人(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
addToBlackList(options)
将好友加入到黑名单
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
list |
Array.<Object>
|
json数组,调用这个函数后黑名单的所有名单列表(已经存在的黑名单加上这次新加黑名单),json的key值为好友的ID,value为之前获取的整个好友对象即可 |
type |
Object
|
要加到黑名单的好友对象的type,默认是"jid" |
list[].order |
Number
|
要加到黑名单的好友对象的order,所有order不重复,可不填 |
list[].jid |
string
|
要加到黑名单的好友的jid |
list[].name |
string
|
要加到黑名单的好友的ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
addToGroupBlackList(options)
- Deprecated:
加入群组黑名单(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
agreeJoinGroup(opt)
通过RestFul API同意用户加入群
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
applicant |
string
|
申请加群的用户ID |
groupId |
Object
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
blockGroup(opt)
- Since:
通过RestFul API屏蔽群组,只对移动端有效
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
需要屏蔽的群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
changeGroupSubject(options)
- Deprecated:
修改群名称(已废弃)
Parameters:
| Name |
Type |
Description |
options |
|
|
close(reason)
断开连接,同时心跳停止
Parameters:
| Name |
Type |
Description |
reason |
String
|
断开原因 |
createGroup(options)
- Deprecated:
创建群组(已废弃)
Example
1. 创建申请 -> 得到房主身份
2. 获取房主信息 -> 得到房间form
3. 完善房间form -> 创建成功
4. 添加房间成员
5. 消息通知成员
Parameters:
| Name |
Type |
Description |
options |
Object
|
- |
createGroupAsync(p)
- Deprecated:
创建群组-异步(已废弃)
Parameters:
| Name |
Type |
Description |
p |
Object
|
- |
createGroupNew(opt)
- Since:
通过RestFul API接口创建群组
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
data |
Object
|
群组信息
Properties
| Name |
Type |
Description |
groupname |
string
|
群组名 |
desc |
string
|
群组描述 |
members |
Array.<string>
|
好友id数组,群好友列表 |
public |
Boolean
|
true: 公开群,false: 私有群 |
approval |
Boolean
|
前提:opt.data.public=true, true: 加群需要审批,false: 加群无需审批 |
allowinvites |
Boolean
|
前提:opt.data.public=false, true: 允许成员邀请入群,false: 不允许成员邀请入群 |
|
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
destroyGroup(options)
- Deprecated:
删除群组(已废弃)
Example
<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>
Parameters:
| Name |
Type |
Description |
options |
Object
|
- |
dissolveGroup(opt)
通过RestFul API解散群组
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
event:unsubscribed(options)
拒绝对方的订阅请求
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
to |
String
|
订阅人的ID |
message |
String
|
发送给拒绝订阅的联系人的验证消息(非必须) |
|
getBlacklist(options)
获取好友黑名单
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
getChatRooms(options)
获取聊天室列表(分页)
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
apiUrl |
String
|
rest的接口地址 |
pagenum |
Number
|
页码,默认1 |
pagesize |
Number
|
每页数量,默认20 |
success |
function
|
成功之后的回调,默认为空 |
|
getGroup(opt)
- Since:
通过RestFul API列出某用户所加入的所有群组
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
getGroupAdmin(opt)
- Since:
通过RestFul API获取群组下所有管理员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
getGroupBlacklist(options)
- Deprecated:
获取群组黑名单(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
getGroupBlacklistNew(opt)
通过RestFul API获取群组黑名单
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
getGroupInfo(opt)
- Since:
通过RestFul API根据groupId获取群组详情
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
getMuted(opt)
通过RestFul API获取群组下所有被禁言成员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
getRoster(options)
获取联系人
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
getUniqueId(prefix)
随机生成一个id用于消息id
Parameters:
| Name |
Type |
Description |
prefix |
String
|
前缀,默认为"WEBIM_" |
groupBlockMulti(opt)
通过RestFul API添加用户至群组黑名单(批量)
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
username |
Array.<string>
|
用户ID数组 |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
groupBlockSingle(opt)
通过RestFul API添加用户至群组黑名单(单个)
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
username |
stirng
|
用户ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
inviteToGroup(opt)
通过RestFul API邀请群成员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组名 |
users |
Array.<string>
|
用户ID数组 |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
joinChatRoom(options)
加入聊天室
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
roomId |
String
|
聊天室的ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
joinGroup(opt)
- Since:
通过RestFul API发出入群申请
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
String
|
加入群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
joinPublicGroup(options)
- Deprecated:
加入公开群组(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
leaveGroup(options)
- Deprecated:
群主从群组中踢人(已废弃)
Example
<iq id="9fb25cf4-1183-43c9-961e-9df70e300de4:sendIQ" to="easemob-demo#chatdemoui_1477481597120@conference.easemob.com" type="set" xmlns="jabber:client">
<query xmlns="http://jabber.org/protocol/muc#admin">
<item affiliation="none" jid="easemob-demo#chatdemoui_lwz4@easemob.com"/>
<item jid="easemob-demo#chatdemoui_lwz4@easemob.com" role="none"/>
<item affiliation="none" jid="easemob-demo#chatdemoui_lwz2@easemob.com"/>
<item jid="easemob-demo#chatdemoui_lwz2@easemob.com" role="none"/>
</query>
</iq>
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
list |
Array.<string>
|
需要从群组移除的好友ID组成的数组 |
roomId |
string
|
群组ID |
|
leaveGroupBySelf(options)
- Deprecated:
主动离开群组(已废弃)
Example
<iq id="5CD33172-7B62-41B7-98BC-CE6EF840C4F6_easemob_occupants_change_affiliation" to="easemob-demo#chatdemoui_1477481609392@conference.easemob.com" type="set">
<query xmlns="http://jabber.org/protocol/muc#admin">
<item affiliation="none" jid="easemob-demo#chatdemoui_lwz2@easemob.com"/>
</query>
</iq>
<presence to="easemob-demo#chatdemoui_1479811172349@conference.easemob.com/mt002" type="unavailable"/>
Parameters:
| Name |
Type |
Description |
options |
Object
|
- |
listen(options)
注册监听函数
Parameters:
| Name |
Type |
Description |
options |
Object
|
回调函数集合
Properties
|
listGroupMember(opt)
通过RestFul API分页列出群组的所有成员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
pageNum |
Number
|
页码,默认1 |
pageSize |
Number
|
每一页的最大群成员数目,最大值1000 |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
listGroups(opt)
- Since:
通过RestFul API分页获取群组列表
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Default |
Description |
limit |
Number
|
|
每一页群组的最大数目 |
cursor |
string
|
null
|
游标,如果数据还有下一页,API 返回值会包含此字段,传递此字段可获取下一页的数据,为null时获取第一页数据 |
success |
function
|
|
成功之后的回调,默认为空 |
error |
function
|
|
失败之后的回调,默认为空 |
|
listRooms(options)
- Deprecated:
获取聊天室列表(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
modifyGroup(opt)
通过RestFul API修改群信息
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
groupName |
string
|
群组名 |
description |
string
|
群组简介 |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
mute(opt)
- Since:
通过RestFul API禁止群用户发言
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
username |
string
|
被禁言的群成员的ID |
muteDuration |
Number
|
被禁言的时长,单位ms |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
open(options)
登录
Parameters:
| Name |
Type |
Description |
options |
Object
|
用户信息
Properties
| Name |
Type |
Description |
user |
String
|
用户名 |
pwd |
String
|
用户密码,跟token二选一 |
accessToken |
String
|
token,跟密码二选一 |
appKey |
String
|
Appkey |
apiUrl |
String
|
Rest 服务地址,非必须。可在项目的WebIMConfig配置 |
xmppURL |
String
|
Xmpp 服务地址,非必须。可在项目的WebIMConfig配置 |
success |
function
|
成功之后的回调,默认为空,token登录没有该回调 |
error |
function
|
失败之后的回调,默认为空,token登录没有该回调 |
|
queryRoomInfo(options)
- Deprecated:
获取群组信息(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
queryRoomMember(options)
- Deprecated:
获取群组成员列表(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
queryRoomOccupants(options)
- Deprecated:
获取聊天室管理员(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
quitChatRoom(options)
退出聊天室
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
roomId |
String
|
聊天室的ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
quitGroup(opt)
通过RestFul API离开群组
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
registerUser(options)
注册新用户
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
username |
String
|
用户名,即用户ID |
password |
String
|
密码 |
nickname |
String
|
用户昵称 |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
rejectInviteFromGroup(options)
- Deprecated:
拒绝入群申请(已废弃)
Example
throw request for now 暂时不处理,直接丢弃
<message to='easemob-demo#chatdemoui_mt002@easemob.com' from='easmeob-demo#chatdemoui_mt001@easemob.com' id='B83B7210-BCFF-4DEE-AB28-B9FE5579C1E2'>
<x xmlns='http://jabber.org/protocol/muc#user'>
<apply to='easemob-demo#chatdemoui_groupid1@conference.easemob.com' from='easmeob-demo#chatdemoui_mt001@easemob.com' toNick='llllll'>
<reason>reject</reason>
</apply>
</x>
</message>
Parameters:
| Name |
Type |
Description |
options |
Object
|
- |
rejectJoinGroup(opt)
通过RestFul API拒绝用户加入群
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
applicant |
string
|
申请加群的用户ID |
groupId |
Object
|
群组ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
removeAdmin(opt)
通过RestFul API取消群管理员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
gorupId |
string
|
群组ID |
username |
string
|
用户ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
removeFromBlackList(options)
将好友从黑名单移除
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
list |
Array.<Object>
|
json数组,调用这个函数后黑名单的所有名单列表,json的key值为好友的ID,value为之前获取的整个好友对象即可 |
type |
Object
|
要加到黑名单的好友对象的type,默认是"jid" |
list[].order |
Number
|
要加到黑名单的好友对象的order,所有order不重复 |
list[].jid |
string
|
要加到黑名单的好友的jid |
list[].name |
string
|
要加到黑名单的好友的ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
removeGroupBlockMulti(opt)
通过RestFul API将用户从群黑名单移除(批量)
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
username |
Array.<string>
|
用户ID数组 |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
removeGroupBlockSingle(opt)
通过RestFul API将用户从群黑名单移除(单个)
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
username |
string
|
用户ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
removeGroupMemberFromBlacklist(options)
- Deprecated:
从群组黑名单删除(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
removeMultiGroupMember(opt)
通过RestFul API删除多个群成员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
users |
Array.<string>
|
用户ID数组 |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
removeMute(opt)
- Since:
通过RestFul API取消对用户禁言
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
username |
string
|
被取消禁言的群用户ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
removeRoster(options)
删除联系人
Example
connection.removeRoster({
to: id,
success: function() {
connection.unsubscribed({
to: id
})
},
error: function() {
}
})
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
to |
String
|
联系人ID |
resource |
String
|
用于生成jid,默认"webim" |
success |
function
|
成功之后的回调,在回调里调用connection.unsubscribed才能真正删除联系人 |
error |
function
|
失败之后的回调,默认为空 |
|
Fires:
removeSingleGroupMember(opt)
通过RestFul API删除单个群成员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
username |
string
|
用户ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
send(messageSource)
发送消息
Example
let deliverMessage = new WebIM.message('delivery', msgId);
deliverMessage.set({
id: msgId,
to: msg.from
});
conn.send(deliverMessage.body);
Parameters:
| Name |
Type |
Description |
messageSource |
Object
|
由 Class Message 生成 |
setAdmin(opt)
通过RestFul API设置群管理员
Parameters:
| Name |
Type |
Description |
opt |
Object
|
-
Properties
| Name |
Type |
Description |
groupId |
string
|
群组ID |
username |
string
|
用户ID |
success |
function
|
成功之后的回调,默认为空 |
error |
function
|
失败之后的回调,默认为空 |
|
subscribe(options)
订阅和反向订阅
Example
A订阅B(A添加B为好友)
A执行:
conn.subscribe({
to: 'B',
message: 'Hello~'
});
B的监听函数onPresence参数message.type == subscribe监听到有人订阅他
B执行:
conn.subscribed({
to: 'A',
message: '[resp:true]'
});
同意A的订阅请求
B继续执行:
conn.subscribe({
to: 'A',
message: '[resp:true]'
});
反向订阅A,这样才算双方添加好友成功。
若B拒绝A的订阅请求,只需执行:
conn.unsubscribed({
to: 'A',
message: 'I don't want to be subscribed'
});
另外,在监听函数onPresence参数message.type == "subscribe"这个case中,加一句
if (message && message.status === '[resp:true]') {
return;
}
否则会进入死循环
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
to |
String
|
想要订阅的联系人 |
nick |
String
|
想要订阅的联系人昵称 (非必须) |
message |
String
|
发送给想要订阅的联系人的验证消息(非必须) |
|
subscribed(options)
被订阅后确认同意被订阅
Parameters:
| Name |
Type |
Description |
options |
Object
|
-
Properties
| Name |
Type |
Description |
to |
String
|
订阅人的ID |
message |
String
|
默认为[resp:true],后续将去掉该参数 |
|
unsubscribe(options)
- Deprecated:
取消订阅成功(已废弃)
Parameters:
| Name |
Type |
Description |
options |
Object
|
|
Type Definitions
onAudioMessage()
收到音频消息
onCmdMessage()
收到命令消息
onCreateGroup()
建群成功后调用
onDeliverdMessage()
收到已送达回执
onEmojiMessage()
收到表情消息
onError()
收到错误消息
onFileMessage()
收到文件消息
onInviteMessage()
被邀请进群
onLocationMessage()
收到位置消息
onMutedMessage()
被群管理员禁言
onOffline()
浏览器被断网时调用
onOnline()
浏览器联网时调用
onOpened()
登录成功后调用
onPictureMessage()
收到图片消息
onPresence()
收到Presence消息
onReadMessage()
收到已读回执
onReceivedMessage()
收到Received消息
onTextMessage()
收到文本消息
onVideoMessage()
收到视频消息