Add Apple platform features and UX improvements
- Add HealthKit State of Mind sync for mood entries - Add Live Activity with streak display and rating time window - Add App Shortcuts/Siri integration for voice mood logging - Add TipKit hints for feature discovery - Add centralized MoodLogger for consistent side effects - Add reminder time setting in Settings with time picker - Fix duplicate notifications when changing reminder time - Fix Live Activity streak showing 0 when not yet rated today - Fix slow tap response in entry detail mood selection - Update widget timeline to refresh at rating time - Sync widgets when reminder time changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
import UserNotifications
|
||||
import UIKit
|
||||
import WidgetKit
|
||||
import SwiftUI
|
||||
|
||||
class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
@@ -56,21 +55,25 @@ extension AppDelegate: @preconcurrency UNUserNotificationCenterDelegate {
|
||||
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
||||
if let action = LocalNotification.ActionType(rawValue: response.actionIdentifier) {
|
||||
let date = ShowBasedOnVoteLogics.getCurrentVotingDate(onboardingData: savedOnboardingData)
|
||||
let mood: Mood
|
||||
switch action {
|
||||
case .horrible:
|
||||
DataController.shared.add(mood: .horrible, forDate: date, entryType: .notification)
|
||||
mood = .horrible
|
||||
case .bad:
|
||||
DataController.shared.add(mood: .bad, forDate: date, entryType: .notification)
|
||||
mood = .bad
|
||||
case .average:
|
||||
DataController.shared.add(mood: .average, forDate: date, entryType: .notification)
|
||||
mood = .average
|
||||
case .good:
|
||||
DataController.shared.add(mood: .good, forDate: date, entryType: .notification)
|
||||
mood = .good
|
||||
case .great:
|
||||
DataController.shared.add(mood: .great, forDate: date, entryType: .notification)
|
||||
mood = .great
|
||||
}
|
||||
|
||||
// Use centralized mood logger
|
||||
MoodLogger.shared.logMood(mood, for: date, entryType: .notification)
|
||||
|
||||
UNUserNotificationCenter.current().setBadgeCount(0)
|
||||
}
|
||||
WidgetCenter.shared.reloadAllTimelines()
|
||||
completionHandler()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user