我正在开发一个Apache Cordova应用程序,我想知道是否可以向调度程序设备添加任务。
I´m developing an Apache Cordova application and I want to know if I can add tasks to the scheduler device.
我必须在以下位置运行警报和通知
I have to run an alarm and notification at a specific time, how can I do this?
我考虑过将任务添加到调度程序设备并委派职责。
I thought about adding a task to the scheduler device and delegate responsibility.
这可能吗?至少是Android 4.4
This is possible? At least Android 4.4
谢谢!
推荐答案首先,请注意:是的,您当然可以。 Sebastian Katzer为此编写了一个插件。可以在这里找到: Cordova-本地通知插件。
first off all: Yes, you're of course able to do so. Sebastian Katzer wrote a plugin for that. It can be found here: Cordova - Local Notification Plugin.
此插件可让您触发预定的事件,例如:每个星期一的凌晨6点触发事件。标准通知的代码如下:
This Plugin allows you to trigger scheduled Events or for example: Trigger events every Monday at 6 a.m. The Code for a standard notification looks like this:
cordova.plugins.notification.local.schedule({ id: 1, title: "Production Jour fixe", text: "Duration 1h", firstAt: monday_9_am, every: "week", sound: "file://sounds/reminder.mp3", icon: "icons/?cal_id=1", data: { meetingId:"123#fg8" } }); cordova.plugins.notification.local.on("click", function (notification) { joinMeeting(notification.data.meetingId); });该消息看起来像一个通知-可以在此处找到其图片:图片-Katzer本地通知
The message looks like a Notification - a picture of that can be found here: Picture - Katzer Local Notifications
还有一个Wiki,可以在这里找到: Katzer Wiki的本地通知
There also is a wiki which can be found here: Local Notifications by Katzer Wiki
希望我帮了您!让我知道您是否需要更多信息!
Hope i helped you! Let me know if you need further information!
更多推荐
添加任务计划程序
发布评论