【问题标题】:Ionic3 LocalNotification every day specifi hourIonic 3 本地通知每天特定时间
【发布时间】:2018-07-27 09:16:27
【问题描述】:

我刚刚查看了docs,但我尝试过的代码只能工作一次。

//this is my code
cordova.plugins.notification.local.schedule({
  id: 1,
  title: 'Attention',
  text: 'Exmaple',
  data: { mydata: 'My hidden message this is' },
  actions: [
    { id: 'yes', title: 'Yes' },
    { id: 'no', title: 'No' }
  ],

  trigger: { every: { hour: 11, minute: 0 } }//work only once
});

我也试过这个(只工作一次)

cordova.plugins.notification.local.schedule({
    title: 'Design team meeting',
    trigger: { in: 1, unit: 'hour' }
});

我希望每天在特定时间收到通知

与这个问题有关:

谢谢大家

【问题讨论】:

  • 有人知道怎么解决吗?
  • 你解决了吗?
  • 不,我没有找到解决办法

标签: triggers ionic3 localnotification


【解决方案1】:

这个解决方案对我有用,使用版本 0.9.0-beta.3 就像在link 上所说的那样,我希望我能帮助你。

let dailyNotification = {
  id: 1,
  title: 'Time to report',
  text: 'Send your report',
  trigger: { every: { hour: 20, minute: 0} }
};

this.localNotifications.schedule(dailyNotification);

【讨论】:

    猜你喜欢
    • 2018-09-26
    • 2023-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-09
    • 2021-07-10
    • 2019-01-01
    相关资源
    最近更新 更多