更新记录
2.24.0(2025-11-06) 下载此版本
对齐 ZEGO 官网 2.24.0 版本。
2.23.0(2025-10-20) 下载此版本
修复内容
- iOS 平台:修复在某些 HBuilderX 版本,分页查询历史消息、分页查询会话列表时引起的崩溃问题。 新增功能 对齐 ZEGO 官网 2.23.0 版本。
2.21.0(2025-07-01) 下载此版本
首次发布,详细请查看 ZEGO 官网。
查看更多平台兼容性
uni-app(4.25)
| Vue2 | Vue2插件版本 | Vue3 | Vue2插件版本 | Chrome | Chrome插件版本 | Safari | Safari插件版本 | app-vue | app-vue插件版本 | app-nvue | app-nvue插件版本 | Android | Android插件版本 | iOS | iOS插件版本 | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| √ | 2.23.0 | √ | 2.23.0 | √ | 2.23.0 | √ | 2.23.0 | √ | 2.23.0 | √ | 2.23.0 | 5.0 | 2.23.0 | 12 | 2.23.0 | × |
| 微信小程序 | 微信小程序插件版本 | 支付宝小程序 | 支付宝小程序插件版本 | 抖音小程序 | 抖音小程序插件版本 | 百度小程序 | 百度小程序插件版本 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| √ | 2.23.0 | √ | 2.23.0 | √ | 2.23.0 | √ | 2.23.0 | - | - | - | - | - | × | × |
uni-app x(4.25)
| Chrome | Chrome插件版本 | Safari | Safari插件版本 | Android | Android插件版本 | iOS | iOS插件版本 | 鸿蒙 | 微信小程序 | 微信小程序插件版本 |
|---|---|---|---|---|---|---|---|---|---|---|
| √ | 2.23.0 | √ | 2.23.0 | 5.0 | 2.23.0 | 12 | 2.23.0 | × | √ | 2.23.0 |
zego-zim-uts
开发文档
Native App 开发
- 制作自定义基座
Web、小程序开发
- 切换到项目 uni_modules/zego-zim-uts 目录下,安装 npm sdk 库,安装成功后可以在该目录下看到 node_modules 目录
cd uni_modules/zego-zim-uts/ npm run install
使用 SDK
import { ZIM, ZIMAppConfig, ZIMLoginConfig, ZIMMessage, ZIMMessageSendConfig, ZIMMessageSendNotification, ZIMConversationQueryConfig, ZIMMessageQueryConfig } from '@/uni_modules/zego-zim-uts';
// 创建实例
const appConfig: ZIMAppConfig = { appID: 0, appSign: '' };
ZIM.create(appConfig);
const zim = ZIM.getInstance();
// 注册回调事件
zim.onConnectionStateChanged((data) => console.log(`state: ${data.state}, event: ${data.event}`)));
// 登录
const userID = '';
const loginConfig: ZIMLoginConfig = { token: '', userName: '', customStatus: '', isOfflineLogin: false };
zim.login(userID, loginConfig)
.then(() => {
// 操作成功
})
.catch((err) => {
// 操作失败
console.error(err);
});
// 发送消息
const sendConfig: ZIMMessageSendConfig = { priority: 1 };
const notification: ZIMMessageSendNotification = {
onMessageAttached: (msg) => {},
};
const textMsg: ZIMMessage = {
type: 1,
message: 'test',
};
zim.sendMessage(textMsg, 'toUserID', 0, sendConfig, notification)
.then((res) => {
// 操作成功
})
.catch((err) => {
// 操作失败
console.error(err);
});
// 分页查询会话列表
zim.queryConversationList({ count: 1, nextConversation: null } as ZIMConversationQueryConfig, null).then((res) => {
console.log('queryConversationList-1', res);
const conv = res.conversationList[res.conversationList.length - 1];
const nextFlag = conv.type.toString() + conv.conversationID;
zim.queryConversationList({ count: 1, nextConversation: nextFlag } as ZIMConversationQueryConfig, null).then((res) => {
console.log('queryConversationList-2', res);
});
});
// 分页查询历史消息
zim.queryHistoryMessage(用户ID, 0, { count: 1, reverse: true, nextMessage: null } as ZIMMessageQueryConfig).then((res) => {
console.log('queryHistoryMessage-1', res);
const nextFlag = res.messageList[0]?.localMessageID;
zim.queryHistoryMessage(用户ID, 0, { count: 1, reverse: true, nextMessage: nextFlag } as ZIMMessageQueryConfig).then((res) => {
console.log('queryHistoryMessage-2', res);
});
});

收藏人数:
下载插件并导入HBuilderX
赞赏(0)
下载 5307
赞赏 1
下载 10997832
赞赏 1800
赞赏
京公网安备:11010802035340号