docs(sdk): 添加 Android SDK 文档和 API 设计规范

- 新增 Android SDK 使用文档,包含模块结构、集成方式和快速开始指南
- 添加 SDK API 重设计规范,统一初始化和登录接口设计
- 补充安全设计规范,完善 UserSig 鉴权和敏感数据处理方案
- 创建平台 REST API 规范,定义服务端到服务端的调用接口
- 添加离线推送架构设计,集成各大厂商推送服务与 IM 联动方案
这个提交包含在:
徐勤民 2026-04-29 15:46:39 +08:00
父节点 53097c5a5c
当前提交 37ca7b75c3

查看文件

@ -6,7 +6,6 @@ import { save, load, clearSession, K } from '../utils/storage'
import pluginMeta from '../../plugin.json' import pluginMeta from '../../plugin.json'
const APP_ID = 'ak_demo_chat' const APP_ID = 'ak_demo_chat'
const SERVER_URL = 'https://dev.xuqinmin.com'
function buildImDbName(appId: string, userId: string): string { function buildImDbName(appId: string, userId: string): string {
return `xuqm_im_${appId}_${userId}` return `xuqm_im_${appId}_${userId}`
@ -32,8 +31,9 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
const [state, setState] = useState<AuthState>({ ready: false, userId: null, profile: null }) const [state, setState] = useState<AuthState>({ ready: false, userId: null, profile: null })
const initSDK = useCallback(async (profile: UserProfile, imToken: string) => { const initSDK = useCallback(async (profile: UserProfile, imToken: string) => {
const appId = profile.appId || APP_ID const appKey = profile.appId || APP_ID
await XuqmSDK.initialize({ appId, serverUrl: SERVER_URL }) await XuqmSDK.initialize({ appKey })
const appId = appKey
await ImSDK.loginWithToken(profile.userId, imToken, buildImDbName(appId, profile.userId)) await ImSDK.loginWithToken(profile.userId, imToken, buildImDbName(appId, profile.userId))
setState({ ready: true, userId: profile.userId, profile }) setState({ ready: true, userId: profile.userId, profile })