Files
2026-02-03 17:43:58 +08:00

25 lines
975 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Daily Widget Reco补充说明 / Overflow
## 1. 关键配置
- **App Group suiteName**`group.com.damer.mindfulness`
- **后端鉴权**:无
- **多语言**:仅 `en / tc`
## 2. 共享存储 KeyApp ↔ Widget
- `widget.config.v1`
- 字段:`schema_version=1``saved_at``apiBaseUrl`
- `widget.userProfile.v1_2`
- 字段:`schema_version=1``saved_at``user_profile`(结构对齐 `UserProfileV1_2`
- `widget.dailyReco.v1`
- 字段:`schema_version=1``saved_at``day_key`(本地日 `YYYY-MM-DD`)、`lang``item{content_id,text}``source`
## 3. 更新策略(双通道)
- **Widget 主动拉取**:缓存过期时请求 `POST /v1/reco/widget`,写回 `widget.dailyReco.v1`,并使用 `TimelinePolicy.after` 设定次日刷新
- **App 辅助刷新**
- 启动与回到前台时调用 `ensureDailyWidgetRecoUpToDate`
- 成功写入缓存后调用 `WidgetCenter.reloadAllTimelines()`(系统仍可能延迟)