Can I schedule events / callbacks at a specified time every day in PhoneGap

Is there a way (in PhoneGap) that I can schedule events or callbacks at the appointed time every day?

I assume that I am looking for something like Android AlarmManager, so that I can trigger some notification every day at a specific time, in order to then prompt the user to launch my application.

Thanks for any help

Matt

+7
cordova
source share
1 answer

You can use this:

https://github.com/katzer/cordova-plugin-local-notifications.git

It allows you to use local device notifications.

After installing this plugin, you will get access to the window.plugin.notification.local variable. Then you can run:

 window.plugin.notification.local.add({ date: new Date(), message: 'Your notification message' }); 

This will cause a notification to appear on the user device on the specified date.

I used this with Moment JS to handle my temporary notifications.

+5
source share

All Articles