OGeek|极客世界-中国程序员成长平台

标题: android - Cordova 本地通知 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 18:12
标题: android - Cordova 本地通知

您好,我正在开发一个程序。我将本地通知集成到程序中,但问题是我不能每天都重复。

plugin

我使用了这个插件,并在设备就绪的 index.js 中编写了这段代码。它工作正常,但是当我第一次添加通知时它会出错。

cordova.plugins.notification.local.schedule({
        id: 1,           
        text: "Come and Evaluate your Friends!",
        firstAt: tomorrow_at_11_am,
        every: "day"
    });

firstAt:明天_at_11_am 部分不工作。我该如何解决这个问题?



Best Answer-推荐答案


tomorrow_at_11_am

是一个变量。示例站点缺少此内容。在这里查看文档:

https://github.com/katzer/cordova-plugin-local-notifications/wiki/04.-Scheduling

在那里你可以找到:

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

关于android - Cordova 本地通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34869998/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4