fix(android): support static reminder notifications and ensure channel exists

Static reminders scheduled via scheduleDailyNotification() with
isStaticReminder=true were being skipped because they don't have content
in storage - title/body are in Intent extras. Fixed by:

- DailyNotificationReceiver: Extract static reminder extras from Intent
  and pass to WorkManager as input data
- DailyNotificationWorker: Check for static reminder flag in input data
  and create NotificationContent from input data instead of loading from
  storage
- DailyNotificationWorker: Ensure notification channel exists before
  displaying (fixes "No Channel found" errors)

Also updated prefetch timing from 5 minutes to 2 minutes before notification
time in plugin code and web UI.
This commit is contained in:
Matthew Raymer
2025-11-18 04:02:56 +00:00
parent e16c55ac1d
commit 8f20da7e8d
5 changed files with 95 additions and 27 deletions

View File

@@ -212,7 +212,7 @@
console.log('Testing notification scheduling...');
const now = new Date();
const notificationTime = new Date(now.getTime() + 600000); // 10 minutes from now
const prefetchTime = new Date(now.getTime() + 300000); // 5 minutes from now
const prefetchTime = new Date(now.getTime() + 120000); // 2 minutes from now
const notificationTimeString = notificationTime.getHours().toString().padStart(2, '0') + ':' +
notificationTime.getMinutes().toString().padStart(2, '0');
const prefetchTimeString = prefetchTime.getHours().toString().padStart(2, '0') + ':' +
@@ -256,10 +256,10 @@
return;
}
// Schedule notification for 10 minutes from now (allows 5 min prefetch to fire)
// Schedule notification for 10 minutes from now (allows 2 min prefetch to fire)
const now = new Date();
const notificationTime = new Date(now.getTime() + 600000); // 10 minutes from now
const prefetchTime = new Date(now.getTime() + 300000); // 5 minutes from now
const prefetchTime = new Date(now.getTime() + 120000); // 2 minutes from now
const notificationTimeString = notificationTime.getHours().toString().padStart(2, '0') + ':' +
notificationTime.getMinutes().toString().padStart(2, '0');
const prefetchTimeString = prefetchTime.getHours().toString().padStart(2, '0') + ':' +