diff --git a/ios/Plugin/DailyNotificationScheduler.swift b/ios/Plugin/DailyNotificationScheduler.swift index 20ffa73..3c47382 100644 --- a/ios/Plugin/DailyNotificationScheduler.swift +++ b/ios/Plugin/DailyNotificationScheduler.swift @@ -389,6 +389,10 @@ class DailyNotificationScheduler { * * @param currentScheduledTime Current scheduled time in milliseconds * @return Next scheduled time in milliseconds (24 hours later) + * + * TESTING: To test with shorter intervals (e.g., 2 minutes), change: + * - Line ~404: `.hour, value: 24` → `.minute, value: 2` + * - Line ~407: `(24 * 60 * 60 * 1000)` → `(2 * 60 * 1000)` */ func calculateNextScheduledTime(_ currentScheduledTime: Int64) -> Int64 { let calendar = Calendar.current @@ -396,8 +400,10 @@ class DailyNotificationScheduler { let currentTimeStr = formatTime(currentScheduledTime) // Add 24 hours (handles DST transitions automatically) + // TESTING: Change `.hour, value: 24` to `.minute, value: 2` for 2-minute testing guard let nextDate = calendar.date(byAdding: .hour, value: 24, to: currentDate) else { // Fallback to simple 24-hour addition if calendar calculation fails + // TESTING: Change `(24 * 60 * 60 * 1000)` to `(2 * 60 * 1000)` for 2-minute testing let fallbackTime = currentScheduledTime + (24 * 60 * 60 * 1000) let fallbackTimeStr = formatTime(fallbackTime) NSLog("DNP-ROLLOVER: DST_CALC_FAILED current=\(currentTimeStr) using_fallback=\(fallbackTimeStr)") @@ -456,6 +462,7 @@ class DailyNotificationScheduler { let lastRolloverTime = await storage.getLastRolloverTime(for: content.id) // If rollover was processed recently (< 1 hour ago), skip + // TESTING: Change `(60 * 60 * 1000)` to `(60 * 1000)` for 1-minute threshold when testing with 2-minute intervals if let lastTime = lastRolloverTime, (currentTime - lastTime) < (60 * 60 * 1000) { let lastTimeStr = formatTime(lastTime)