Add task scheduler

I am developing an Apache Cordova application and I want to know if I can add tasks to the scheduler device.

I need to start an alarm and notification at a specific time, how can I do this?

I was thinking about adding a task to the scheduler device and delegating responsibility.

Is it possible? At least Android 4.4

Thank!

+3


source to share


1 answer


first of all: Yes, you can of course do it. Sebastian Katzer wrote a plugin for this. It can be found here: Cordova - Local Alert Plugin .

This plugin allows you to run scheduled events or for example: Trigger events every Monday at 6 am. The code for the 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: "http://icons.com/?cal_id=1",
    data: { meetingId:"123#fg8" }
});

cordova.plugins.notification.local.on("click", function (notification) {
    joinMeeting(notification.data.meetingId);
});

      



The message looks like a Notice - the image can be found here: Image - Katzer Local Notices

There is also a wiki that can be found here: Local Notifications from the Katzer Wiki

Hope I helped you! Let me know if you need more information!

+3


source







All Articles