应用程序关闭时,离子 2 本地通知不起作用

Posted

技术标签:

【中文标题】应用程序关闭时,离子 2 本地通知不起作用【英文标题】:ionic 2 local notifications not working when app close 【发布时间】:2017-09-29 08:41:51 【问题描述】:

我正在使用 ionic 2 本地通知。当我从后台删除应用程序时,本地通知不起作用。

这是示例代码

this.localNotifications.schedule(
        text: 'Delayed ILocalNotification',
        every:'minute',
        at: new Date(new Date().getTime() + 60000),
        led: 'FF0000',
        sound: null
     );

【问题讨论】:

【参考方案1】:

试试这个推送通知。 https://ionicframework.com/docs/native/push/

本地通知需要应用在后台运行。

【讨论】:

以上是关于应用程序关闭时,离子 2 本地通知不起作用的主要内容,如果未能解决你的问题,请参考以下文章