Files
daily-notification-plugin/ios/Plugin
Matthew Raymer a54ba34cb9 feat(ios): Enhance battery optimization and notification management
Description:
- Add battery status and power state monitoring
- Implement adaptive scheduling based on battery levels
- Add maintenance worker for background tasks
- Enhance logging with structured DailyNotificationLogger
- Add configuration management with DailyNotificationConfig
- Define constants in DailyNotificationConstants
- Improve error handling and recovery mechanisms

Testing:
- Add comprehensive test coverage for battery optimization
- Add test coverage for power state management
- Add test coverage for maintenance tasks
- Add test coverage for configuration management
- Add test coverage for constants validation

Documentation:
- Add comprehensive file-level documentation
- Add method-level documentation
- Add test documentation
- Add configuration documentation

This commit improves the iOS implementation's reliability and battery
efficiency by adding robust error handling, logging, and configuration
management to make the plugin more maintainable and debuggable.
2025-03-28 03:50:54 -07:00
..

iOS Implementation

This directory contains the iOS-specific implementation of the DailyNotification plugin.

Implementation Details

The iOS implementation uses:

  • BGTaskScheduler for background data fetching
  • UNUserNotificationCenter for notification management
  • UserDefaults for local data storage
  • iOS notification categories and actions

Native Code Location

The native iOS implementation is located in the ios/ directory at the project root.

Key Components

  1. DailyNotificationIOS.swift: Main plugin class
  2. BackgroundTaskManager.swift: Handles background fetch scheduling
  3. NotificationManager.swift: Manages notification creation and display
  4. DataStore.swift: Handles local data persistence

Implementation Notes

  • Uses BGTaskScheduler for reliable background execution
  • Implements proper battery optimization handling
  • Supports iOS notification categories and actions
  • Handles background refresh limitations
  • Uses UserDefaults for lightweight data storage

Testing

Run iOS-specific tests with:

npm run test:ios