android - 通知永远不会在模拟器中显示
问题描述
我正在尝试在某个日期和时间显示通知。我已经尝试了很多,但它从未在模拟器中显示。我找到并编辑了这段代码:
createnotification() {
let remindid = new Date().getUTCMilliseconds();
this.date = moment(“2019-01-31 12:20:00”).format(“YYYY-MM-DD HH:mm:ss”);
let notification = {
id: remindid,
title: this.title,
text: this.description,
forceShow: 'true',
coldstart: true,
foreground: false,
at: this.date
};
cordova.plugins.notification.local.schedule(notification);
let alert = this.alrtCtrl.create({
title: 'Notifications set at ' + this.date,
buttons: ['Ok']
});
alert.present();
}
我认为这与“at”属性有关。我尝试了日期的不同变体,使用了“触发器”属性。似乎没有任何效果。
我错过了什么?
解决方案
固定的:
Monthnumbers 从零开始,所以我指的是三月。
一月 = 0
二月 = 1
三月 = 2
等等。
推荐阅读
- haskell - 无法安装 ghc-exactprint
- reactjs - 操作成功后重定向
- sjplot - sjPlot plot_model 线之间的距离
- c - How to make Sqlite work in Windows 10 at the publication
- php - 向 URL 发送查询后 cURL 返回 NULL
- kubernetes - 通过 Airflow 创建的 Kubernetes pod 保持运行状态
- python - Python C 扩展导入器如何使用导入锁
- lua - 迭代表
- rstudio - 使用基数报告作为博客文章,并从基数保存 .md
- javascript - 如何重新加载具有相同域但不同端口的选项卡