我希望每天上午10:00收到本地通知。 我的代码是:
var pushTime = moment().add(0, 'days').hours(10).minutes(0).seconds(0);
cordova.plugins.notification.local.schedule({
id: 1,
text: 'Tracking Enabled ',
trigger: { at: pushTime.toDate() },
every: 'day'
});
答案 0 :(得分:0)
尝试使用触发器,如下所示:
trigger: {
firstAt: pushTime.toDate(),
every: ELocalNotificationTriggerUnit.DAY
}
答案 1 :(得分:0)
let notifications = []
let template = {
data: "value",
id: 1,
title: "daily alarm",
text: 'Code something epic today!',
launch: true,
foreground: true,
trigger: { every: { hour: 10, minute: 0 } },
}
notifications.push(template)
cordova.plugins.notification.local.schedule(notifications);