如何在Flutter应用程序中过期/处置通知
我在应用程序中启用了通知及其工作正常,但是如果新通知在一定持续时间后到达或到期,我该如何到期呢?
I enabled notifications in my app and its working fine but how can I expire an old notification if a new one arrives or expire it after a certain duration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“ Flutter_local_notifications”插件具有解散通知的方法。但是,目前尚无方法可以获取当前通知的列表。您需要自行跟踪它们(例如,像共享流程这样的持久存储)。
The "flutter_local_notifications" plugin has a method to dismiss notifications. However, there is currently no method to get a list of the present notifications. You need to track them on your own (e.g. some persistent storage like SharedPreferences).
检索未决通知请求:
的ID值的通知
取消具有零取消/删除所有通知
,您可以通过 flutter_local_notifications 。
Retrieving pending notification requests :
cancel the notification with id value of zero
Cancelling/deleting all notifications
you can achieve this with the flutter_local_notifications.