问题
Hi I am developing a program. I integrated local notification to program, but problem is that i cant do it repeatly everyday .
plugin
I used this plugin and wrote this code in index.js in device ready. it is working normally but when i add first time for notification it gives error.
cordova.plugins.notification.local.schedule({
id: 1,
text: "Come and Evaluate your Friends!",
firstAt: tomorrow_at_11_am,
every: "day"
});
firstAt: tomorrow_at_11_am part is not working. How can i fix this solution?
回答1:
tomorrow_at_11_am
is a variable. The example site is missing this. Have a look at the docs here:
https://github.com/katzer/cordova-plugin-local-notifications/wiki/04.-Scheduling
There you can find:
at, firstAt (Date or Number)
The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately. - Default: now ~ new Date()
来源:https://stackoverflow.com/questions/34869998/cordova-local-notification