I am trying to use the GCMTaskManager to schedule a periodic task that runs approximately every 30 minutes. When it runs, it does an "update" on some internal data in the APP.
I have this preliminarily running and can see, using a LOG
command in the OnRunTask
, that the task fires as desired.I have it operating (at least according to a LOG I am populating when the OnRunTask
fires.
I have two issues I can't determine if it can be done....
Is there a way to see how much time is "left" before the next
OnRunTask
fires... or... approximately what "time" it should run next? Example, if there is 30 minutes for the PeriodTask... and 18 minutes have lapsed, can we programmatically see that 12 minutes remain?I have an internal "button" to manual fire the APPS update. If the user hits this, I want to "restart" the PeriodicTask timer from that point. That is, if the 30 minute
OnRunTask
is suppose to fire in approximately 12 minutes, and the user hits the UPDATE manually, I want theOnRunTask
to now restart from for 30 minutes from the button press. Can this be done?
Thanks
Pete