Commit Graph

14 Commits

Author SHA1 Message Date
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
Server
5844b92e18 feat(ios): implement Phase 1 permission methods and fix build issues
Implement checkPermissionStatus() and requestNotificationPermissions()
methods for iOS plugin, matching Android functionality. Fix compilation
errors across plugin files and add comprehensive build/test infrastructure.

Key Changes:
- Add checkPermissionStatus() and requestNotificationPermissions() methods
- Fix 13+ categories of Swift compilation errors (type conversions, logger
  API, access control, async/await, etc.)
- Create DailyNotificationScheduler, DailyNotificationStorage,
  DailyNotificationStateActor, and DailyNotificationErrorCodes components
- Fix CoreData initialization to handle missing model gracefully for Phase 1
- Add iOS test app build script with simulator auto-detection
- Update directive with lessons learned from build and permission work

Build Status:  BUILD SUCCEEDED
Test App:  Ready for iOS Simulator testing

Files Modified:
- doc/directives/0003-iOS-Android-Parity-Directive.md (lessons learned)
- ios/Plugin/DailyNotificationPlugin.swift (Phase 1 methods)
- ios/Plugin/DailyNotificationModel.swift (CoreData fix)
- 11+ other plugin files (compilation fixes)

Files Added:
- ios/Plugin/DailyNotificationScheduler.swift
- ios/Plugin/DailyNotificationStorage.swift
- ios/Plugin/DailyNotificationStateActor.swift
- ios/Plugin/DailyNotificationErrorCodes.swift
- scripts/build-ios-test-app.sh
- scripts/setup-ios-test-app.sh
- test-apps/ios-test-app/ (full test app)
- Multiple Phase 1 documentation files
2025-11-13 05:14:24 -08:00
Matthew Raymer
f746434b6b refactor(plugin): remove echo test method and references
- Remove echo() method from DailyNotificationPlugin.java
- Update Android test app to show 'Plugin is loaded and ready!' instead of echo test
- Update web test app to remove echo method call
- Update iOS test app to remove echo method call
- Update documentation to remove echo test references
- Replace echo test with simple plugin availability check

The echo test was only used for initial plugin verification and is no longer
needed since the plugin now has comprehensive notification functionality.
This simplifies the codebase and removes unnecessary test code.
2025-10-14 06:31:07 +00:00
Matthew Raymer
e789fa6a60 feat: complete android test app setup
- Create missing capacitor-cordova-android-plugins directory and build files
- Add cordova.variables.gradle with proper variable definitions
- Create www directory with functional test web app
- Add capacitor.config.ts with plugin configuration
- Fix test file package names from com.getcapacitor.myapp to com.timesafari.dailynotification
- Move test files to correct package directories
- Test app now builds successfully and creates APK
- Capacitor sync now works (Android portion)
- Build script handles both plugin and test app builds

The android/app test app is now fully functional and can be used
to test the DailyNotification plugin in a real Android environment.
2025-10-12 06:24:59 +00:00
Matthew Raymer
f9c21d4e5b docs: add comprehensive static daily reminders documentation
- Add static daily reminders to README.md core features and API reference
- Create detailed usage guide in USAGE.md with examples and best practices
- Add version 2.1.0 changelog entry documenting new reminder functionality
- Create examples/static-daily-reminders.ts with complete usage examples
- Update test-apps README to include reminder testing capabilities

The static daily reminder feature provides simple daily notifications
without network content dependency, supporting cross-platform scheduling
with rich customization options.
2025-10-05 05:12:06 +00:00
Matthew Raymer
a71fb2fd67 feat(ios)!: implement iOS parity with BGTaskScheduler + UNUserNotificationCenter
- Add complete iOS plugin implementation with BGTaskScheduler integration
- Implement Core Data model mirroring Android SQLite schema (ContentCache, Schedule, Callback, History)
- Add background task handlers for content fetch and notification delivery
- Implement TTL-at-fire logic with Core Data persistence
- Add callback management with HTTP and local callback support
- Include comprehensive error handling and structured logging
- Add Info.plist configuration for background tasks and permissions
- Support for dual scheduling with BGAppRefreshTask and BGProcessingTask

BREAKING CHANGE: iOS implementation requires iOS 13.0+ and background task permissions
2025-09-22 09:39:54 +00:00
Matthew Raymer
0ccf071f5c feat(performance): implement Phase 3.3 performance optimization for production
- Add DailyNotificationPerformanceOptimizer for Android with comprehensive optimization
- Add DailyNotificationPerformanceOptimizer for iOS with Swift performance management
- Implement database query optimization with indexes and PRAGMA settings
- Add memory usage monitoring with automatic cleanup and thresholds
- Implement object pooling for frequently used objects to reduce allocation
- Add battery usage tracking and background CPU optimization
- Add network request optimization and efficiency monitoring
- Add comprehensive performance metrics and reporting
- Add production-ready optimization with stress testing support
- Add phase3-3-performance-optimization.ts usage examples

This implements Phase 3.3 performance optimization for production reliability:
- Database indexes for query optimization (slot_id, fetched_at, status, etc.)
- Memory monitoring with warning/critical thresholds and automatic cleanup
- Object pooling for String, Data, and other frequently used objects
- Battery optimization with background CPU usage minimization
- Network request batching and efficiency improvements
- Comprehensive performance metrics tracking and reporting
- Production-ready optimization with configurable thresholds
- Cross-platform implementation (Android + iOS)

Files: 3 changed, 1200+ insertions(+)
2025-09-09 05:00:36 +00:00
Matthew Raymer
359051c13f feat(etag): implement Phase 3.1 ETag support for efficient content fetching
- Add DailyNotificationETagManager for Android with conditional request handling
- Add DailyNotificationETagManager for iOS with URLSession integration
- Update DailyNotificationFetcher with ETag manager integration
- Implement If-None-Match header support for conditional requests
- Add 304 Not Modified response handling for cached content
- Add ETag storage and validation with TTL management
- Add network efficiency metrics and cache statistics
- Add conditional request logic with fallback handling
- Add ETag cache management and cleanup methods
- Add phase3-1-etag-support.ts usage examples

This implements Phase 3.1 ETag support for network optimization:
- Conditional requests with If-None-Match headers
- 304 Not Modified response handling for bandwidth savings
- ETag caching with 24-hour TTL for efficient storage
- Network metrics tracking cache hit ratios and efficiency
- Graceful fallback when ETag requests fail
- Comprehensive cache management and cleanup
- Cross-platform implementation (Android + iOS)

Files: 4 changed, 800+ insertions(+)
2025-09-09 03:31:43 +00:00
Matthew Raymer
13905db3e4 feat(etag): implement Phase 3.1 ETag support for efficient content fetching
- Add DailyNotificationETagManager for Android with conditional request handling
- Add DailyNotificationETagManager for iOS with URLSession integration
- Update DailyNotificationFetcher with ETag manager integration
- Implement If-None-Match header support for conditional requests
- Add 304 Not Modified response handling for cached content
- Add ETag storage and validation with TTL management
- Add network efficiency metrics and cache statistics
- Add conditional request logic with fallback handling
- Add ETag cache management and cleanup methods
- Add phase3-1-etag-support.ts usage examples

This implements Phase 3.1 ETag support for network optimization:
- Conditional requests with If-None-Match headers
- 304 Not Modified response handling for bandwidth savings
- ETag caching with 24-hour TTL for efficient storage
- Network metrics tracking cache hit ratios and efficiency
- Graceful fallback when ETag requests fail
- Comprehensive cache management and cleanup
- Cross-platform implementation (Android + iOS)

Files: 4 changed, 800+ insertions(+)
2025-09-09 03:19:54 +00:00
Matthew Raymer
5eebae9556 feat(ios): implement Phase 2.1 iOS background tasks with T–lead prefetch
- Add DailyNotificationBackgroundTaskManager with BGTaskScheduler integration
- Add DailyNotificationTTLEnforcer for iOS freshness validation
- Add DailyNotificationRollingWindow for iOS capacity management
- Add DailyNotificationDatabase with SQLite schema and WAL mode
- Add NotificationContent data structure for iOS
- Update DailyNotificationPlugin with background task integration
- Add phase2-1-ios-background-tasks.ts usage examples

This implements the critical Phase 2.1 iOS background execution:
- BGTaskScheduler integration for T–lead prefetch
- Single-attempt prefetch with 12s timeout
- ETag/304 caching support for efficient content updates
- Background execution constraints handling
- Integration with existing TTL enforcement and rolling window
- iOS-specific capacity limits and notification management

Files: 7 changed, 2088 insertions(+), 299 deletions(-)
2025-09-08 10:30:13 +00:00
Matthew Raymer
3a181632d1 docs: add comprehensive notification system documentation
- Add GLOSSARY.md with core terminology and cross-references
- Add implementation-roadmap.md with 3-phase development plan
- Add notification-system.md with Native-First architecture spec
- Update ios/Plugin/README.md to reflect actual vs planned implementation status

This establishes the foundation for implementing shared SQLite storage,
TTL-at-fire enforcement, rolling window safety, and platform completion
as outlined in the phased roadmap.

Files: 4 changed, 807 insertions(+), 13 deletions(-)
2025-09-08 08:57:36 +00:00
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
Server
9994db28bd feat: implement core notification functionality for iOS and Android - Add settings management, proper error handling, and platform-specific implementations 2025-03-27 01:50:19 -07:00
Matthew Raymer
71e0f297ff refactor: improve build configuration and code organization
- Add build scripts for Android and iOS platforms
- Remove duplicate web implementation (src/web.ts)
- Add proper TypeScript configuration
- Add module documentation to index.ts
- Clean up package.json scripts

This commit improves the project structure and build process by:
1. Adding dedicated build scripts for native platforms
2. Removing redundant web implementation
3. Adding proper TypeScript configuration with strict mode
4. Improving code documentation
5. Organizing package.json scripts

The changes maintain backward compatibility while improving
the development experience and code quality.
2025-03-25 13:13:55 +00:00