From 37ca7b75c3311f78ba74adaeb37f1c18557ddd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Wed, 29 Apr 2026 15:46:39 +0800 Subject: [PATCH] =?UTF-8?q?docs(sdk):=20=E6=B7=BB=E5=8A=A0=20Android=20SDK?= =?UTF-8?q?=20=E6=96=87=E6=A1=A3=E5=92=8C=20API=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 Android SDK 使用文档,包含模块结构、集成方式和快速开始指南 - 添加 SDK API 重设计规范,统一初始化和登录接口设计 - 补充安全设计规范,完善 UserSig 鉴权和敏感数据处理方案 - 创建平台 REST API 规范,定义服务端到服务端的调用接口 - 添加离线推送架构设计,集成各大厂商推送服务与 IM 联动方案 --- src/context/AuthContext.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context/AuthContext.tsx b/src/context/AuthContext.tsx index 804bacd..ab954d3 100644 --- a/src/context/AuthContext.tsx +++ b/src/context/AuthContext.tsx @@ -6,7 +6,6 @@ import { save, load, clearSession, K } from '../utils/storage' import pluginMeta from '../../plugin.json' const APP_ID = 'ak_demo_chat' -const SERVER_URL = 'https://dev.xuqinmin.com' function buildImDbName(appId: string, userId: string): string { return `xuqm_im_${appId}_${userId}` @@ -32,8 +31,9 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { const [state, setState] = useState({ ready: false, userId: null, profile: null }) const initSDK = useCallback(async (profile: UserProfile, imToken: string) => { - const appId = profile.appId || APP_ID - await XuqmSDK.initialize({ appId, serverUrl: SERVER_URL }) + const appKey = profile.appId || APP_ID + await XuqmSDK.initialize({ appKey }) + const appId = appKey await ImSDK.loginWithToken(profile.userId, imToken, buildImDbName(appId, profile.userId)) setState({ ready: true, userId: profile.userId, profile })