Reputation: 67
I am trying to configure local notification in my ionic app using cordova-plugin-local-notification
. But it is not working.
Please suggest where i am doing the mistake.
Now i am using the below query to set the 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
});
Upvotes: 0
Views: 279
Reputation: 86
Convert the notiftime
variable to int before:
var notiftime = localStorage.getItem("notifytime");
var time = parseInt(notiftime);
new Date(new Date().getTime() + time);
Upvotes: 1