Ionic framework ionic中的本地通知
这是我的密码Ionic framework ionic中的本地通知,ionic-framework,ionic2,ionic3,ionic-native,Ionic Framework,Ionic2,Ionic3,Ionic Native,这是我的密码 this.platform.ready().then(() => { this.localNotifications.schedule({ // ionic local notification native plugin. title: 'Welcome', text: 'xxxxxxxxxx', at: new Date(new Date().getTime() + 1000) }) }
this.platform.ready().then(() => {
this.localNotifications.schedule({ // ionic local notification native plugin.
title: 'Welcome',
text: 'xxxxxxxxxx',
at: new Date(new Date().getTime() + 1000)
})
})
当使用at:
变量时,我得到的错误为
类型为“{title:any;text:string;at:Date;}”的参数不是
可分配给“ILocalNotification”类型的参数|
“通知”。对象文字只能指定已知属性,
“ILocalNotification”类型中不存在“at”|
“通知”
我想在1秒后提示通知。如何操作?您的选项对象与本地通知选项不匹配,请查看此链接。在这里,您可以找到所有选项。对于计划1秒延迟本地通知,您可以这样修改代码
this.localNotifications.schedule({
title: 'Welcome',
text: 'xxxxxxxxxx',
trigger: {at: new Date(new Date().getTime() + 1000)},
});
希望你能找到解决办法