Commit Graph

11 Commits

Author SHA1 Message Date
Matthew Raymer
8ec63a7876 feat(www): show prefetch and notification times in schedule success message
Update www/index.html scheduleNotification() function to calculate and display
both prefetch time (5 minutes before) and notification time in the success message,
matching the behavior added to the development app assets version.

This provides users with clear visibility into when the PBS prefetch will run
and when the notification will actually fire.
2025-10-30 07:19:54 +00:00
Matthew Raymer
0e783a8a2d feat(android): add diagnostic logging for prefetch scheduling
- Add comprehensive logging to scheduleBackgroundFetch method
  - Log scheduledTime and currentTime for comparison
  - Log calculated fetch time and delay in ms, hours, and minutes
  - Log detailed timing information for future vs past fetch times
  - Add fallback path logging for immediate fetch scenarios

- Add logging to scheduleDailyNotification callback
  - Log scheduled notification result with content details
  - Log when scheduleBackgroundFetch is called
  - Add error logging when notification scheduling fails

- Add WorkManager status logging in DailyNotificationFetcher
  - Log work ID when work is enqueued
  - Log detailed timing information (delay_ms, delay_hours)
  - Add past time detection with duration logging
  - Improve immediate fetch fallback logging

- Add prefetch scheduling trace documentation
  - Document complete code flow from notification to prefetch
  - Include debugging checklist and log search patterns
  - Add ADB commands for troubleshooting

These changes enable better debugging of prefetch scheduling issues
by providing detailed timing and execution information at every
decision point in the prefetch scheduling flow.
2025-10-27 12:40:04 +00:00
Matthew Raymer
4a8573ec87 fix(test-app): implement Schedule Notification button functionality
- Replace empty TODO with actual plugin integration
- Add dynamic import of DailyNotification plugin
- Implement proper error handling with try/catch
- Add user feedback via alert dialogs
- Add comprehensive logging for debugging
- Fix TypeScript priority type with 'high' as const
- Successfully schedules notifications with AlarmManager
- Verified alarm appears in dumpsys alarm output

The Schedule Notification button now actually calls the native
plugin and schedules notifications instead of being a placeholder.
2025-10-23 12:51:15 +00:00
Matthew Raymer
ff89dc75a0 fix(web): remove mock echo function from web test app
- Remove echo function from mock DailyNotification plugin
- Align web version with Android version (no echo test)
- Ensure consistent behavior across all test platforms

This completes the echo test removal across all platforms:
- Android: Removed echo method from plugin and test app
- Web: Removed mock echo function
- iOS: Already updated in previous commit

All test apps now use direct notification testing without echo dependency.
2025-10-14 06:35:54 +00: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
8b614de844 fix: add mock DailyNotification plugin for WebView testing
- Create mock implementation of DailyNotification plugin for WebView
- Mock echo, configure, and getStatus methods with Promise-based responses
- Add console logging for debugging
- Ensure functions work even when native plugin isn't available

This resolves the JavaScript errors by providing a working mock
implementation for testing the plugin interface in WebView.
2025-10-13 02:57:51 +00:00
Matthew Raymer
84b098d22f fix: improve JavaScript function definitions and add cache-busting
- Wrap function definitions in DOMContentLoaded event listener
- Add cache-busting meta tags to prevent WebView caching
- Add console logging for debugging
- Ensure functions are properly attached to window object

This should resolve the 'function not defined' JavaScript errors
and prevent WebView from using cached HTML files.
2025-10-12 06:41:56 +00:00
Matthew Raymer
cbbae27ef6 fix: resolve JavaScript module import error in test app
- Replace ES module imports with global Capacitor objects
- Add null checks for DailyNotification plugin availability
- Fix 'Failed to resolve module specifier @capacitor/core' error
- Use window.Capacitor and window.DailyNotification instead of imports

This resolves the JavaScript error that was preventing the web
interface from loading properly in the test app.
2025-10-12 06:35: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
9a679cd69b refactor: remove web support for native-first architecture
- Remove IndexedDB storage implementation (~90 lines)
- Remove 'web' platform from type definitions
- Remove web platform registration from plugin
- Update storage factory to exclude web platform
- Remove web-specific SSR safety checks from vite-plugin
- Delete web implementation files (src/web/, www/)

BREAKING CHANGE: Web (PWA) platform support removed. Plugin now
supports Android, iOS, and Electron platforms only.
2025-10-08 06:17:24 +00: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