2026-05-16 00:26:53 +08:00
|
|
|
|
# Flutter 安装配置
|
|
|
|
|
|
|
|
|
|
|
|
**包名**:`xuqm_flutter_sdk` · **版本**:0.2.x · **语言**:Dart
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
|
|
|
|
|
|
|
SDK 通过 Gitea Git 仓库发布,在 `pubspec.yaml` 中配置:
|
|
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
|
dependencies:
|
|
|
|
|
|
xuqm_flutter_sdk:
|
|
|
|
|
|
git:
|
|
|
|
|
|
url: https://xuqinmin.com/xuqinmin12/XuqmGroup-FlutterSDK.git
|
docs: fix version numbers, add license SDK docs; fix service gating reactivity
- Android: correct version header 0.5.x→0.4.x, add sdk-license to module table, update artifact versions to 0.4.10
- iOS: correct min version iOS 14→16, bump version to 0.2.0, update SPM ref to from: "0.2.0"
- RN: fix version 0.3.x→0.2.x, standardize npm registry URL, add @xuqm/rn-license to module table
- Flutter: update git ref to v0.2.2, add xuqm_flutter_license to module tables
- Add new docs: ios/license, rn/push, rn/license, flutter/push, flutter/update, flutter/license
- tenant-platform: make appKey a computed ref in Push/VersionManagementView to fix service gating reactivity on route change
- tenant-platform: add requestActivation API endpoint
- tenant-platform: add IM service gating UI (checkServiceEnabled + activation dialog)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 02:23:57 +08:00
|
|
|
|
ref: v0.2.2
|
2026-05-16 00:26:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
> Gitea Package Registry 暂不支持 Dart/Flutter 包格式,因此通过 Git Tag 方式发布。
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 模块说明
|
|
|
|
|
|
|
|
|
|
|
|
| 模块 | 包 | 功能 |
|
|
|
|
|
|
|------|-----|------|
|
|
|
|
|
|
| `xuqm_flutter_common` | `packages/common` | 初始化、网络、配置管理 |
|
|
|
|
|
|
| `xuqm_flutter_im` | `packages/im` | 单聊、群聊、消息收发、会话、好友、群组 |
|
|
|
|
|
|
| `xuqm_flutter_push` | `packages/push` | 设备 Token 注册、厂商检测(Android)/ APNs(iOS)|
|
|
|
|
|
|
| `xuqm_flutter_update` | `packages/update` | App 版本检查、商店跳转、APK 下载(Android)|
|
docs: fix version numbers, add license SDK docs; fix service gating reactivity
- Android: correct version header 0.5.x→0.4.x, add sdk-license to module table, update artifact versions to 0.4.10
- iOS: correct min version iOS 14→16, bump version to 0.2.0, update SPM ref to from: "0.2.0"
- RN: fix version 0.3.x→0.2.x, standardize npm registry URL, add @xuqm/rn-license to module table
- Flutter: update git ref to v0.2.2, add xuqm_flutter_license to module tables
- Add new docs: ios/license, rn/push, rn/license, flutter/push, flutter/update, flutter/license
- tenant-platform: make appKey a computed ref in Push/VersionManagementView to fix service gating reactivity on route change
- tenant-platform: add requestActivation API endpoint
- tenant-platform: add IM service gating UI (checkServiceEnabled + activation dialog)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 02:23:57 +08:00
|
|
|
|
| `xuqm_flutter_license` | `packages/license` | 设备授权注册与验证(License SDK)|
|
2026-05-16 00:26:53 +08:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 初始化
|
|
|
|
|
|
|
|
|
|
|
|
```dart
|
|
|
|
|
|
import 'package:xuqm_flutter_sdk/xuqm_flutter_sdk.dart';
|
|
|
|
|
|
|
|
|
|
|
|
await XuqmSDK.initialize(XuqmInitOptions(
|
|
|
|
|
|
appKey: 'your_app_key',
|
|
|
|
|
|
debug: true,
|
|
|
|
|
|
));
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
初始化时会自动向服务端请求远程配置(IM API 地址等),若网络异常则回退到内置默认值。
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 多模块统一登录
|
|
|
|
|
|
|
|
|
|
|
|
无论集成了哪些模块(IM、Push、Update),**初始化和登录永远只做一次**:
|
|
|
|
|
|
|
|
|
|
|
|
```dart
|
|
|
|
|
|
// 初始化
|
|
|
|
|
|
await XuqmSDK.initialize(XuqmInitOptions(appKey: 'your_app_key'));
|
|
|
|
|
|
|
|
|
|
|
|
// 登录(业务登录成功后调用一次)
|
|
|
|
|
|
await XuqmImSdk().login('user_001', 'your_user_sig_jwt');
|
|
|
|
|
|
|
|
|
|
|
|
// 登出
|
|
|
|
|
|
await XuqmImSdk().logout();
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 下一步
|
|
|
|
|
|
|
|
|
|
|
|
- [Flutter IM 接入 →](./im)
|
docs: fix version numbers, add license SDK docs; fix service gating reactivity
- Android: correct version header 0.5.x→0.4.x, add sdk-license to module table, update artifact versions to 0.4.10
- iOS: correct min version iOS 14→16, bump version to 0.2.0, update SPM ref to from: "0.2.0"
- RN: fix version 0.3.x→0.2.x, standardize npm registry URL, add @xuqm/rn-license to module table
- Flutter: update git ref to v0.2.2, add xuqm_flutter_license to module tables
- Add new docs: ios/license, rn/push, rn/license, flutter/push, flutter/update, flutter/license
- tenant-platform: make appKey a computed ref in Push/VersionManagementView to fix service gating reactivity on route change
- tenant-platform: add requestActivation API endpoint
- tenant-platform: add IM service gating UI (checkServiceEnabled + activation dialog)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 02:23:57 +08:00
|
|
|
|
- [Flutter 推送接入 →](./push)
|
|
|
|
|
|
- [Flutter 版本更新 →](./update)
|
|
|
|
|
|
- [Flutter 授权管理 →](./license)
|