
鸿雁即时通讯是数睿科技公司旗下的一款专注于为开发者提供实时聊天技术和服务的产品。我们的团队来自数睿科技,致力于为用户提供高效稳定的实时聊天云服务,且弹性可扩展,对外提供较为简洁的API接口,让您轻松实现快速集成即时通讯功能。
SDK 兼容主流浏览器(不支持IE)
npm i @addcnos/hongyan-web-sdk
// 初始化SDK
let im = new IM({wssUrl:_wssUrl,url:_httpUrl}); //wssUrl:websocket服务域名,url:im接口域名
//websocket连接成功
im.on('ready',function(){
});
//websocket异常
im.on('error',function(){
});
//websocket消息通知
im.on('message',function(){
});
//连接websocket服务
im.connect({token:_token});
//发送消息
im.sendMessage({conversationID: _conversationID,type: _type,content:_content;push:_push})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
type |
String |
消息的类型 |
content |
String |
消息的内容 |
push |
Number |
是否进行推送(默认为0,不推送) |
//获取聊天列表
im.getConversationList({count: _count;page: _page})
参数 |
类型 |
说明 |
count |
Number |
查询条数 |
page |
Number |
页数 |
//拉取历史消息
let msgList = im.getMessageList({conversationID:this.targetId});
msgList.next();
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//发送消息已读
im.setMessageRead({conversationID:_conversationID})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//获取所有的新消息数
im.getUnreadCount()
//获取会员信息
im.getProfile({conversationID:_conversationID})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//删除联络人
im.deleteConversation({conversationID:_conversationID})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//上传图片
im.uploadImage(file)
更新日期:2022年8月30日
1.web sdk基础功能

鸿雁即时通讯是数睿科技公司旗下的一款专注于为开发者提供实时聊天技术和服务的产品。我们的团队来自数睿科技,致力于为用户提供高效稳定的实时聊天云服务,且弹性可扩展,对外提供较为简洁的API接口,让您轻松实现快速集成即时通讯功能。
SDK 兼容主流浏览器(不支持IE)
npm i @addcnos/hongyan-web-sdk
// 初始化SDK
let im = new IM({wssUrl:_wssUrl,url:_httpUrl}); //wssUrl:websocket服务域名,url:im接口域名
//websocket连接成功
im.on('ready',function(){
});
//websocket异常
im.on('error',function(){
});
//websocket消息通知
im.on('message',function(){
});
//连接websocket服务
im.connect({token:_token});
//发送消息
im.sendMessage({conversationID: _conversationID;type: _type,content:_content;push:_push})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
type |
String |
消息的类型 |
content |
String |
消息的内容 |
push |
Number |
是否进行推送(默认为0,不推送) |
//获取聊天列表
im.getConversationList({count: _count;page: _page})
参数 |
类型 |
说明 |
count |
Number |
查询条数 |
page |
Number |
页数 |
//拉取历史消息
let msgList = im.getMessageList({conversationID:this.targetId});
msgList.next();
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//发送消息已读
im.setMessageRead({conversationID:_conversationID})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//获取所有的新消息数
im.getUnreadCount()
//获取会员信息
im.getProfile({conversationID:_conversationID})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//删除联络人
im.deleteConversation({conversationID:_conversationID})
参数 |
类型 |
说明 |
conversationID |
String |
聊天目标id |
//上传图片
im.uploadImage(file)
更新日期:2022年11月28日
1.依赖升级
2.文档修改
更新日期:2022年8月30日
1.web sdk基础功能