Implemented history and config management methods: getHistory(): - Returns history entries with optional filters (since, kind, limit) - Uses Core Data History entity - Filters by timestamp and kind - Sorts by occurredAt descending (most recent first) - Returns history array matching Android API getHistoryStats(): - Returns statistics about history entries - Counts outcomes and kinds - Finds mostRecent and oldest timestamps - Returns totalCount, outcomes, kinds, mostRecent, oldest - Uses Core Data for aggregation getAllConfigs(): - Returns all configurations (limited by UserDefaults enumeration) - Supports optional filters (timesafariDid, configType) - Note: UserDefaults doesn't support key enumeration directly - Returns empty array (limitation documented) updateConfig(): - Updates existing configuration value - Validates config exists before updating - Supports optional timesafariDid for scoped configs - Handles JSON and plain string values - Returns updated config deleteConfig(): - Deletes configuration by key - Validates config exists before deletion - Supports optional timesafariDid for scoped configs - Removes from UserDefaults iOS Adaptations: - Uses Core Data History entity for history storage - UserDefaults for config storage (enumeration limitation) - Timestamp conversion (Date to milliseconds) - Predicate-based filtering for Core Data queries Progress: 52/52 methods implemented (100% COMPLETE!)
iOS Implementation
This directory contains the iOS-specific implementation of the DailyNotification plugin.
Current Implementation Status
✅ IMPLEMENTED:
- Basic plugin structure (
DailyNotificationPlugin.swift) - UserDefaults for local data storage
- Power management (
DailyNotificationPowerManager.swift) - Battery optimization handling
- iOS notification categories and actions
❌ NOT IMPLEMENTED (Planned):
BGTaskSchedulerfor background data fetching- Background task management
- Silent push nudge support
- T–lead prefetch logic
Implementation Details
The iOS implementation currently uses:
UNUserNotificationCenterfor notification management ✅UserDefaultsfor local data storage ✅- iOS notification categories and actions ✅
- Power management and battery optimization ✅
Planned additions:
BGTaskSchedulerfor background data fetching- Background task management
- Silent push support
Native Code Location
The native iOS implementation is located in the ios/ directory at the project root.
Key Components
DailyNotificationPlugin.swift: Main plugin class ✅DailyNotificationPowerManager.swift: Power state management ✅DailyNotificationConfig.swift: Configuration options ✅DailyNotificationMaintenanceWorker.swift: Maintenance tasks ✅DailyNotificationLogger.swift: Logging system ✅
Missing Components (Planned):
BackgroundTaskManager.swift: Handles background fetch schedulingNotificationManager.swift: Manages notification creation and displayDataStore.swift: Handles local data persistence
Implementation Notes
- Uses UserDefaults for lightweight data storage ✅
- Implements proper battery optimization handling ✅
- Supports iOS notification categories and actions ✅
- Handles background refresh limitations ✅
Planned Features:
- BGTaskScheduler for reliable background execution
- Silent push notification support
- Background task budget management
Testing
Run iOS-specific tests with:
npm run test:ios