加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

推送通知 – 颤动:即使应用程序已关闭,也会推送通知

发布时间:2020-12-14 14:52:08 所属栏目:百科 来源:网络整理
导读:我已经构建了一个带有颤动的应用程序,就像提醒一样. 即使应用程序已关闭,如何向用户显示通知? 解决方法 对于提醒我会建议 Flutter Local Notifications Plugin.它有一个强大的调度api.从本地通知的文件: Scheduling when notifications should appear – P
我已经构建了一个带有颤动的应用程序,就像提醒一样.
即使应用程序已关闭,如何向用户显示通知?

解决方法

对于提醒我会建议 Flutter Local Notifications Plugin.它有一个强大的调度api.从本地通知的文件:

Scheduling when notifications should appear – Periodically show a
notification (interval-based) – Schedule a notification to be shown
daily at a specified time – Schedule a notification to be shown weekly
on a specified day and time – Ability to handle when a user has tapped on a notification when the app is the foreground,background or terminated

对于推送通知,您可以使用Firebase Cloud Messaging
或one signal插件,也可以通过platform-channels本地实现

编辑:即使应用程序终止,您也可以根据特定条件触发通知.这可以通过在后台运行dart代码来实现.引用官方常见问题解答:

Can I run Dart code in the background of an Flutter app? Yes,you can run Dart code in a background process on both iOS and Android. For more information,see the Medium article 07004

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读