简体   繁体   English

使用 flutter_local_notifications 插件时,挂起的通知在重启后被取消

[英]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.

相关问题 使用 flutter_local_notifications 安排通知 - Schedule notification using flutter_local_notifications 如何使用flutter插件显示多个通知:flutter_local_notifications - How to display multiple notifications using flutter plugin : flutter_local_notifications 计划通知未显示(Flutter_local_notifications) - scheduled notifications not showing (Flutter_local_notifications) flutter_local_notifications 插件未在通知中显示大图像 - flutter_local_notifications plugin not showing the big image in notification Flutter:使用 FCM 在前台运行时,flutter_local_notifications 不起作用 - Flutter: flutter_local_notifications not work when running in Foreground with FCM Flutter:应用程序终止时,flutter_local_notifications onSelectNotification 不起作用 - Flutter : flutter_local_notifications onSelectNotification not working when app is terninated flutter_local_notifications onNotificationReceived 方法 - Flutter - flutter_local_notifications onNotificationReceived method - Flutter 有没有办法使用 flutter_local_notifications 跳过重复通知? - Is there a way to skip a recurring notification using flutter_local_notifications? 在 flutter_local_notifications 上禁用振动 - Disable vibration on flutter_local_notifications 在 Xcode 中找不到模块“flutter_local_notifications” - Module 'flutter_local_notifications' not found in Xcode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM