Skip to content

fix(android): reschedule alarms on device reboot via BootReceiver - #22

Merged
KashifKhn merged 11 commits into
mainfrom
fix/boot-receiver
Aug 11, 2026
Merged

fix(android): reschedule alarms on device reboot via BootReceiver#22
KashifKhn merged 11 commits into
mainfrom
fix/boot-receiver

Conversation

@KashifKhn

Copy link
Copy Markdown
Owner

Summary

  • Adds BootReceiver.kt — a BroadcastReceiver that handles BOOT_COMPLETED and LOCKED_BOOT_COMPLETED intents and reschedules all future alarms via NativeAlarmScheduler
  • Extends NativeAlarmStore to persist full scheduling metadata (title, body, sound, scheduledTimeMillis) as a JSON entry so BootReceiver has everything it needs without involving Flutter
  • Registers BootReceiver in AndroidManifest.xml with the correct intent filters (BOOT_COMPLETED + LOCKED_BOOT_COMPLETED)

Acceptance Criteria

  • BootReceiver Kotlin class exists and handles BOOT_COMPLETED / LOCKED_BOOT_COMPLETED intents
  • BootReceiver is registered in AndroidManifest.xml with the correct intent filters
  • RECEIVE_BOOT_COMPLETED permission is declared in the manifest
  • After a reboot, all enabled alarms fire at their correct next time without the user opening the app

Closes #10

@vercel

vercel Bot commented Mar 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drawbell Ready Ready Preview, Comment Apr 1, 2026 0:37am

@KashifKhn

Copy link
Copy Markdown
Owner Author

Potential bug (high impact for reboot reliability): repeating alarms may be lost after reboot if their last scheduled time is already in the past.

In BootReceiver.onReceive, entries are skipped when entry.scheduledTimeMillis <= now, and NativeAlarmStore entries only persist a single scheduledTimeMillis (not repeat metadata like hour/minute/repeatDays for normal entries).

Scenario:

  1. A repeating alarm is scheduled for 08:00
  2. Device reboots at 09:00
  3. BootReceiver skips the stored entry as past
  4. The next repeat is never re-armed unless/until the app is opened (which later calls rescheduleAll())

This seems to violate the acceptance criterion that enabled alarms should fire correctly after reboot without opening the app.

@KashifKhn
KashifKhn merged commit 2cacb4e into main Aug 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: BOOT_COMPLETED receiver missing — alarms not rescheduled after reboot

1 participant