Files
daily-notification-plugin/ios/Plugin
Server ed25b1385a fix(ios): enable Capacitor plugin discovery via CAPBridgedPlugin conformance
Capacitor iOS was not discovering DailyNotificationPlugin because it did not
conform to the CAPBridgedPlugin protocol required for runtime discovery.

Changes:
- Add @objc extension to DailyNotificationPlugin implementing CAPBridgedPlugin
  with identifier, jsName, and pluginMethods properties
- Force-load plugin framework in AppDelegate before Capacitor initializes
- Remove duplicate BGTaskScheduler registration from AppDelegate (plugin handles it)
- Update podspec to use dynamic framework (static_framework = false)
- Add diagnostic logging to verify plugin discovery

Result: Plugin is now discovered by Capacitor and all methods are accessible
from JavaScript. Verified working with checkPermissionStatus() method.

Files modified:
- ios/Plugin/DailyNotificationPlugin.swift: Added CAPBridgedPlugin extension
- test-apps/ios-test-app/ios/App/App/AppDelegate.swift: Force-load + diagnostics
- ios/DailyNotificationPlugin.podspec: Dynamic framework setting
- doc/directives/0003-iOS-Android-Parity-Directive.md: Documented solution
2025-11-13 23:29:03 -08:00
..

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):

  • BGTaskScheduler for background data fetching
  • Background task management
  • Silent push nudge support
  • Tlead prefetch logic

Implementation Details

The iOS implementation currently uses:

  • UNUserNotificationCenter for notification management
  • UserDefaults for local data storage
  • iOS notification categories and actions
  • Power management and battery optimization

Planned additions:

  • BGTaskScheduler for 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

  1. DailyNotificationPlugin.swift: Main plugin class
  2. DailyNotificationPowerManager.swift: Power state management
  3. DailyNotificationConfig.swift: Configuration options
  4. DailyNotificationMaintenanceWorker.swift: Maintenance tasks
  5. DailyNotificationLogger.swift: Logging system

Missing Components (Planned):

  • BackgroundTaskManager.swift: Handles background fetch scheduling
  • NotificationManager.swift: Manages notification creation and display
  • DataStore.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