Cordova Local Notification

你说的曾经没有我的故事 提交于 2019-12-07 19:26:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!