简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM