Reputation: 8880
This Phonegap plugin provides a neat way to schedule repeating background local notifications - at least on Android. The bit of the documentation I do not understand is this - the every
attribute can be a string or a number. I want to set up local notifications that repeat at 10 minute intervals. I thought I would try every:600
.
var dd = new Date();
cordova.plugins.notification.local.schedule({
text: "Delayed Notification",
firstAt: dd,
every: 600}, localNote);
where
function localNote(){navigator.notification.beep(2);}
However, this does not work - OTH every:"minute" produces minutely beeps. I'd be much obliged to anyone who might be able to tell me what I am doing wrong here.
Upvotes: 0
Views: 289
Reputation: 189
Digging through the code I see that if you pass in a number they multiply it by 60000, so I'm assuming they're expecting you to pass in the number as minutes, try passing in 10. Actually, the docs also state this:
That can be a value of minutes or one of
second
,minute
,hour
,day
,week
,month
oryear
The code that I'm talking about is here: parseInterval.
Hope this helps.
Upvotes: 1