flutter

When using the flutter_local_notifications plugin, pending notifications are cancelled after a reboot


I have created a simple TODO app in flutter with reminder functionality. I am using the flutter_local_notifications plugin's scheduled notification option and it words as expected.

However, whenever I reboot the device all scheduled notifications are cancelled automatically.

Is there any way to prevent scheduled notifications from being cancelled during a reboot?

Edit: solved by using flutter_background_fetch


Solution

  • Notifications are not persistent and will always be gone after the system restart or reboot. If you want them to reappear you need to do that yourself, listening to ACTION_BOOT_COMPLETED broadcast and then acting appropriately which means posting your notifications again.