Ionic 本地通知基于在本地存储中选择和保存的日期和时间
Ionic local Notifications based on selected and saved date and time in localstorage
我正在尝试使用 cordova-plugin-local-notification
在我的离子应用程序中配置本地通知。但它不起作用。
请指出我哪里做错了。
现在我使用下面的查询来设置通知。
localStorage.setItem("notifytime", "3600");
var notiftime = localStorage.getItem("notifytime");
this.localNotifications.schedule({
text: 'Delayed ILocalNotification',
trigger: {at: new Date(new Date().getTime() + notiftime)},
led: 'FF0000',
sound: null
});
之前将notiftime
变量转换为int:
var notiftime = localStorage.getItem("notifytime");
var time = parseInt(notiftime);
new Date(new Date().getTime() + time);
我正在尝试使用 cordova-plugin-local-notification
在我的离子应用程序中配置本地通知。但它不起作用。
请指出我哪里做错了。
现在我使用下面的查询来设置通知。
localStorage.setItem("notifytime", "3600");
var notiftime = localStorage.getItem("notifytime");
this.localNotifications.schedule({
text: 'Delayed ILocalNotification',
trigger: {at: new Date(new Date().getTime() + notiftime)},
led: 'FF0000',
sound: null
});
之前将notiftime
变量转换为int:
var notiftime = localStorage.getItem("notifytime");
var time = parseInt(notiftime);
new Date(new Date().getTime() + time);