IOS-INFO-038:AppContext 采集与上传上下文 #126

Open
opened 2026-06-10 22:15:05 +08:00 by wangdl · 0 comments
Owner

目标

定义 iOS 上传阅读事件时需要补充的 AppContext,包括 platform、appVersion、clientTimezoneOffsetMinutes 等字段,供 Rust Event → UploadItem 映射使用。

需要采集的字段

  • platform
  • appVersion
  • buildNumber
  • clientTimezoneOffsetMinutes
  • locale?
  • deviceType?
  • osVersion?

字段来源

platform: iOS 固定为 ios,或根据运行环境区分 ios / ipadOS

appVersion: Bundle.main.infoDictionary["CFBundleShortVersionString"]

buildNumber: Bundle.main.infoDictionary["CFBundleVersion"]

clientTimezoneOffsetMinutes: TimeZone.current.secondsFromGMT() / 60

locale: Locale.current.identifier

deviceType: phone / tablet,按 UIDevice 或当前适配逻辑判断

osVersion: UIDevice.current.systemVersion

规则

  1. AppContext 可在 App 启动时初始化。
  2. 上传前允许重新读取 timezone,避免跨时区长时间运行导致偏差。
  3. AppContext 不包含用户隐私字段。
  4. AppContext 不包含 token。
  5. AppContext 由 iOS 补充,不传给 Rust document runtime。
  6. IOS-INFO-012 映射 UploadItem 时必须使用 AppContext。

验收标准

  1. 新增 AppContext 类型。
  2. 可读取 platform。
  3. 可读取 appVersion。
  4. 可读取 buildNumber。
  5. 可读取 clientTimezoneOffsetMinutes。
  6. IOS-INFO-012 可使用 AppContext 生成 UploadItem。
  7. 有单元测试。
  8. 不依赖 API 实现。
## 目标 定义 iOS 上传阅读事件时需要补充的 AppContext,包括 platform、appVersion、clientTimezoneOffsetMinutes 等字段,供 Rust Event → UploadItem 映射使用。 ## 需要采集的字段 - platform - appVersion - buildNumber - clientTimezoneOffsetMinutes - locale? - deviceType? - osVersion? ## 字段来源 platform: iOS 固定为 ios,或根据运行环境区分 ios / ipadOS appVersion: Bundle.main.infoDictionary["CFBundleShortVersionString"] buildNumber: Bundle.main.infoDictionary["CFBundleVersion"] clientTimezoneOffsetMinutes: TimeZone.current.secondsFromGMT() / 60 locale: Locale.current.identifier deviceType: phone / tablet,按 UIDevice 或当前适配逻辑判断 osVersion: UIDevice.current.systemVersion ## 规则 1. AppContext 可在 App 启动时初始化。 2. 上传前允许重新读取 timezone,避免跨时区长时间运行导致偏差。 3. AppContext 不包含用户隐私字段。 4. AppContext 不包含 token。 5. AppContext 由 iOS 补充,不传给 Rust document runtime。 6. IOS-INFO-012 映射 UploadItem 时必须使用 AppContext。 ## 验收标准 1. 新增 AppContext 类型。 2. 可读取 platform。 3. 可读取 appVersion。 4. 可读取 buildNumber。 5. 可读取 clientTimezoneOffsetMinutes。 6. IOS-INFO-012 可使用 AppContext 生成 UploadItem。 7. 有单元测试。 8. 不依赖 API 实现。
wangdl added this to the M-IOS-INFO:学习信息采集、上传、继续学习与基础分析闭环 milestone 2026-06-10 22:15:05 +08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/ios-projects#126
No description provided.