From 3cf95f1ee168861f7e809cffc4144692bbc2d82d Mon Sep 17 00:00:00 2001 From: wangdl Date: Sat, 4 Jul 2026 11:35:23 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20README=20=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIStudyApp/README.md | 73 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/AIStudyApp/README.md b/AIStudyApp/README.md index eca152a..05953bc 100644 --- a/AIStudyApp/README.md +++ b/AIStudyApp/README.md @@ -136,6 +136,79 @@ Clean Build 之前先: rm -rf ~/Library/Developer/Xcode/DerivedData/AIStudyApp-* ``` +## 环境配置 + +### Debug 模式(本地开发) + +Debug 构建自动连接本地 API(`http://127.0.0.1:3000`),通过 `Debug.xcconfig` 配置: + +``` +API_BASE_URL = http://127.0.0.1:3000 +``` + +Info.plist 已配置 ATS 豁免 localhost。 + +### Release 模式(生产) + +Release 构建连接生产 API(`https://api.longde.cloud`)。 + +### 切换 API 地址 + +编辑 `AIStudyApp/Config/Debug.xcconfig` 中的 `API_BASE_URL`。 + +## Rust FFI 集成 + +知习跨平台文档内核 `zhixi-document-runtime` 通过 UniFFI 生成 Swift 绑定。 + +### 构建流程 + +```bash +# 在 zhixi-document-runtime 仓库 +cd zhixi-document-runtime +./scripts/build-ios.sh + +# 生成的 Swift 文件复制到 iOS 项目 +# → AIStudyApp/Core/FFI/zhixi_document_core.swift +``` + +### 集成功能 + +- 文件类型检测 +- Markdown / TXT / EPUB 解析 +- PDF 阅读位置管理 +- 图片元数据提取 +- 阅读时长事件 +- 全文搜索和笔记锚点 + +详见 `zhixi-document-runtime/docs/ios-integration.md` + +## App Store 提审 + +提审相关文档见 `ios-projects/docs/`: +- App Store 提审清单 +- Firebase 集成 +- Rust FFI 更新 +- 阅读信息集成 + +## 依赖 + +| 依赖 | 用途 | +|------|------| +| SwiftUI | UI 框架 | +| Firebase | 推送通知 / Analytics(可选) | +| zhixi-document-runtime | 跨平台文档内核(Rust FFI) | + +## 调试日志 + +所有 `print()` 输出使用 `[PageName]` 前缀标记页面来源: + +```swift +print("[ImportPage] 文件导入完成") +print("[AIChat] 消息发送: \(message)") +``` + +在 Xcode Console 中可通过前缀过滤日志。 + ## 最近修复记录 ### 2026-05-19 — NavigationStack 迁移 + Dynamic Type