Understand the library data model
mainThe library relies on persisting configuration and event history to UserDefaults. The key components are:
- familyActivitySelectionId mapping: Maps a
familyActivitySelectiontoken to a reusable ID. - Triggers: Configures shield UI/actions and handles background tasks (web requests/notifications) from the Swift side. These are stored in
UserDefaultswith the prefixactions*for${goalId}. - Event history: Stores information about triggered events and timestamps, prefixed with
events_${goalId}inUserDefaults. - ShieldIds: Used to reference shields in
UserDefaultsto reduce storage strain.