From 663c0eeb10ace588acecf7a508f21d5a35fc1aec Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Fri, 8 May 2026 12:00:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(update):=20=E6=B7=BB=E5=8A=A0=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=9B=B4=E6=96=B0=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=94=A8=E6=88=B7ID=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在UpdateApi接口中新增可选的userId查询参数 - 新增UpdateSDK对象用于统一管理应用更新逻辑 - 实现应用版本检查、下载安装和APK文件处理功能 - 添加下载URL规范化处理逻辑 - 在Flutter SDK中新增update模块实现跨平台更新功能 - 在iOS SDK中新增UpdateSDK类提供应用更新检查接口 - 支持Android和iOS平台的应用商店跳转功能 - 添加React Native SDK的更新检查和插件注册功能 - 实现RN Bundle的检查、下载和缓存机制 --- Sources/XuqmSDK/Update/UpdateSDK.swift | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Sources/XuqmSDK/Update/UpdateSDK.swift b/Sources/XuqmSDK/Update/UpdateSDK.swift index b61de65..aabc66d 100644 --- a/Sources/XuqmSDK/Update/UpdateSDK.swift +++ b/Sources/XuqmSDK/Update/UpdateSDK.swift @@ -20,13 +20,18 @@ public final class UpdateSDK { public func checkAppUpdate(currentVersionCode: Int) async throws -> AppUpdateInfo { let config = XuqmSDK.shared.requireConfig() + let userId = XuqmSDK.shared.currentUserId + var queryItems = [ + URLQueryItem(name: "appKey", value: config.appKey), + URLQueryItem(name: "platform", value: "IOS"), + URLQueryItem(name: "currentVersionCode", value: "\(currentVersionCode)"), + ] + if let userId, !userId.isEmpty { + queryItems.append(URLQueryItem(name: "userId", value: userId)) + } return try await ApiClient.shared.request( path: "/api/v1/updates/app/check", - queryItems: [ - URLQueryItem(name: "appKey", value: config.appKey), - URLQueryItem(name: "platform", value: "IOS"), - URLQueryItem(name: "currentVersionCode", value: "\(currentVersionCode)"), - ] + queryItems: queryItems ) }