Implement comprehensive data access layer for Core Data entities: - Add NotificationContentDAO, NotificationDeliveryDAO, and NotificationConfigDAO with full CRUD operations and query helpers - Add DailyNotificationDataConversions utility for type conversions (Date ↔ Int64, Int ↔ Int32, JSON, optional strings) - Update PersistenceController with entity verification and migration policies - Add comprehensive unit tests for all DAO classes and data conversions - Update Core Data model with NotificationContent, NotificationDelivery, and NotificationConfig entities (relationships and indexes) - Integrate ReactivationManager into DailyNotificationPlugin.load() DAO Features: - Create/Insert methods with dictionary support - Read/Query methods with predicates (by timesafariDid, notificationType, scheduledTime range, deliveryStatus, etc.) - Update methods (touch, updateDeliveryStatus, recordUserInteraction) - Delete methods (by ID, by key, delete all) - Relationship management (NotificationContent ↔ NotificationDelivery) - Cascade delete support Test Coverage: - 328 lines: DailyNotificationDataConversionsTests (time, numeric, string, JSON) - 490 lines: NotificationContentDAOTests (CRUD, queries, updates) - 415 lines: NotificationDeliveryDAOTests (CRUD, relationships, cascade delete) - 412 lines: NotificationConfigDAOTests (CRUD, queries, active filtering) All tests use in-memory Core Data stack for isolation and speed. Completes sections 4.4, 4.5, and 6.0 of iOS implementation checklist.
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