0

I use Phonegap/Cordova for developing mobile app. In the application I set local notifications once each day. But notification time changes every day. So I need to set local notification with a cronjob for each day.

How can I add cronjob with cordova?

Alexander
  • 1,720
  • 4
  • 22
  • 40

1 Answers1

1

I am not sure you can do this. iOS doesn't allow background processes, so once you close your app, it is done running.

I have scheduled runs and do it on the server side. If the notifications change everday, you can run the cron job every minute to see if conditions are right, then send a push notification to the device.

Matt Kuhns
  • 1,328
  • 1
  • 13
  • 26
  • The time of notifications is belong to local time(user device local time) so push notification doesnt solve my problem. I have to use local notifications. – Alexander Mar 22 '16 at 14:09
  • I don't really know a way it can be done on the app side. You could store the time in UTC and the user's time zone on the server, then send notifications when that time comes up. – Matt Kuhns Mar 22 '16 at 20:51