Add AI-powered mental wellness features: Reflection Companion, Pattern Tags, Weekly Digest
Three new Foundation Models features to deepen user engagement with mental wellness: 1. AI Reflection Companion — personalized feedback after completing guided reflections, referencing the user's actual words with personality-pack-adapted tone 2. Mood Pattern Tags — auto-extracts theme tags (work, family, stress, etc.) from notes and reflections, displayed as colored pills on entries 3. Weekly Emotional Digest — BGTask-scheduled Sunday digest with headline, summary, highlight, and intention; shown as card in Insights tab with notification All features: on-device (zero cost), premium-gated, iOS 26+ with graceful degradation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,10 @@ struct ReflectApp: App {
|
||||
guard let processingTask = task as? BGProcessingTask else { return }
|
||||
BGTask.runWeatherRetryTask(task: processingTask)
|
||||
}
|
||||
BGTaskScheduler.shared.register(forTaskWithIdentifier: BGTask.weeklyDigestID, using: nil) { task in
|
||||
guard let processingTask = task as? BGProcessingTask else { return }
|
||||
BGTask.runWeeklyDigestTask(task: processingTask)
|
||||
}
|
||||
UNUserNotificationCenter.current().setBadgeCount(0)
|
||||
|
||||
// Reset tips session on app launch
|
||||
@@ -98,6 +102,7 @@ struct ReflectApp: App {
|
||||
}.onChange(of: scenePhase) { _, newPhase in
|
||||
if newPhase == .background {
|
||||
BGTask.scheduleBackgroundProcessing()
|
||||
BGTask.scheduleWeeklyDigest()
|
||||
WidgetCenter.shared.reloadAllTimelines()
|
||||
// Flush pending analytics events
|
||||
AnalyticsManager.shared.flush()
|
||||
|
||||
Reference in New Issue
Block a user