Reputation: 239
This is my code
this.platform.ready().then(() => {
this.localNotifications.schedule({ // ionic local notification native plugin.
title: 'Welcome',
text: 'xxxxxxxxxx',
at: new Date(new Date().getTime() + 1000)
})
})
When use the at:
variable I get the error as
Argument of type ‘{ title: any; text: string; at: Date; }’ is not assignable to parameter of type ‘ILocalNotification | ILocalNotification’. Object literal may only specify known properties, and ‘at’ does not exist in type ‘ILocalNotification | ILocalNotification’.
I want to prompt the notification after 1 sec. How can I do it ?
Upvotes: 0
Views: 215
Reputation: 867
Your options object is not match with local-notifications options kindly review this link https://ionicframework.com/docs/native/local-notifications/. Here you can find the all the options. For schedule 1 second delay local-notification you can modify code like this.
this.localNotifications.schedule({
title: 'Welcome',
text: 'xxxxxxxxxx',
trigger: {at: new Date(new Date().getTime() + 1000)},
});
Hope you find your solutions.
Upvotes: 1