feat: Implement pending notifications screen and enhance notification handling

This commit is contained in:
2025-08-26 18:15:35 +02:00
parent 2aec59ec35
commit 53dfd92cec
6 changed files with 457 additions and 14 deletions

View File

@@ -99,6 +99,7 @@ class SupplementProvider with ChangeNotifier {
required int reminderRetryInterval,
required int maxRetryAttempts,
}) async {
print('📱 🔄 MANUAL CHECK: Persistent reminders called from UI');
await _notificationService.checkPersistentReminders(
persistentReminders,
reminderRetryInterval,
@@ -106,6 +107,16 @@ class SupplementProvider with ChangeNotifier {
);
}
// Add a manual trigger method for testing
Future<void> triggerRetryCheck() async {
print('📱 🚨 MANUAL TRIGGER: Forcing retry check...');
await checkPersistentRemindersWithSettings(
persistentReminders: true,
reminderRetryInterval: 5, // Force 5 minute interval for testing
maxRetryAttempts: 3,
);
}
@override
void dispose() {
_persistentReminderTimer?.cancel();
@@ -363,6 +374,11 @@ class SupplementProvider with ChangeNotifier {
return await _notificationService.getPendingNotifications();
}
// Get pending notifications with retry information from database
Future<List<Map<String, dynamic>>> getTrackedNotifications() async {
return await DatabaseHelper.instance.getPendingNotifications();
}
// Debug method to test notification persistence
Future<void> rescheduleAllNotifications() async {
await _rescheduleAllNotifications();