[英]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.我已经创造了扑与提醒功能的简单TODO应用程序。 I am using the
flutter_local_notifications
plugin's scheduled notification
option and it words as expected.我正在使用
flutter_local_notifications
插件的scheduled notification
选项,它按预期使用。
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编辑:通过使用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.
如果你想让它们重新出现,你需要自己做,听ACTION_BOOT_COMPLETED 广播,然后采取适当的行动,这意味着再次发布你的通知。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.