Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework ionic中的本地通知_Ionic Framework_Ionic2_Ionic3_Ionic Native - Fatal编程技术网

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)},
   });
希望你能找到解决办法