Cordova Local Notification

2019-05-28 17:48发布

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条回答
男人必须洒脱
2楼-- · 2019-05-28 18:12

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()

查看更多
登录 后发表回答