添加任务计划程序

编程入门 行业动态 更新时间:2024-10-10 10:32:32
本文介绍了添加任务计划程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一个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!

更多推荐

添加任务计划程序

本文发布于:2023-11-23 21:23:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622905.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:计划   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!