feat(sdk): 更新 SDK 设计文档和 API 重构

- 添加 expiresAt 和 refreshUserSig 参数支持自动续签
- 修改 PushSDK 初始化方式,自动完成设备注册和厂商初始化
- 调整过期续签策略,从提前 15 分钟改为提前 5 分钟触发
- 重构 RN SDK 文档结构,简化安装和使用方式
- 更新统一登录流程,支持 profile 信息传递
- 添加 IM 数据库自动隔离功能
- 修复 Android 群消息聚合问题
- 补充自动化测试验证和错误处理机制
这个提交包含在:
徐勤民 2026-05-01 21:27:38 +08:00
父节点 5ec928da81
当前提交 ac72012443
共有 2 个文件被更改,包括 26 次插入0 次删除

查看文件

@ -7,6 +7,7 @@ Page({
activeTab: 'conv',
conversations: [],
friends: [],
groups: [],
messages: [],
currentTarget: '',
currentChatType: 'SINGLE',
@ -25,6 +26,7 @@ Page({
this.loadConversations()
this.loadFriends()
this.loadGroups()
},
onUnload() {
@ -65,6 +67,21 @@ Page({
this.setData({ activeTab: e.currentTarget.dataset.tab })
},
async loadGroups() {
try {
const groups = await app.globalData.sdk.listGroups()
this.setData({ groups })
} catch (err) {
console.error('loadGroups failed', err)
}
},
startGroupChat(e) {
const id = e.currentTarget.dataset.id
this.setData({ currentTarget: id, currentChatType: 'GROUP', messages: [] })
this.loadHistory(id, 'GROUP')
},
selectConv(e) {
const { id, type } = e.currentTarget.dataset
this.setData({ currentTarget: id, currentChatType: type, messages: [] })

查看文件

@ -8,6 +8,7 @@
<view class="tab-bar">
<view class="tab {{activeTab==='conv'?'active':''}}" bindtap="switchTab" data-tab="conv">会话</view>
<view class="tab {{activeTab==='friend'?'active':''}}" bindtap="switchTab" data-tab="friend">好友</view>
<view class="tab {{activeTab==='group'?'active':''}}" bindtap="switchTab" data-tab="group">群组</view>
</view>
<scroll-view scroll-y class="list">
@ -25,6 +26,14 @@
</view>
<view wx:if="{{friends.length===0}}" class="empty">暂无好友</view>
</block>
<block wx:if="{{activeTab==='group'}}">
<view wx:for="{{groups}}" wx:key="id" class="item" bindtap="startGroupChat" data-id="{{item.id}}">
<view class="item-title">{{item.name}}</view>
<view class="item-meta">{{item.memberIds ? JSON.parse(item.memberIds).length : 0}} 人</view>
</view>
<view wx:if="{{groups.length===0}}" class="empty">暂无群组</view>
</block>
</scroll-view>
</view>