-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current interval timer request. #5
Comments
Hi, are you going to implement this feature? |
Sorry ... yes, but it might be a while yet (as per the same reasons I gave in the other issue). Once I've got the automated build & test up and running, the plan of attack is:
I just need to work this in with day job, vacation, etc, etc. I'd like to try and get done in July .... but to be honest I suspect it will be August. |
Have a question about this. |
The doWork() is currently called based on the timer. However there is no reason that code cannot be called on some other event (such as a listener). If you look at the source code for the Background Service (https://github.com/Red-Folder/Cordova-Plugin-BackgroundService-Source/blob/master/src/com/red_folder/phonegap/plugin/backgroundservice/BackgroundService.java), you should be able to extend to run the doWork via another method. |
Changes made and committed to Github (1bdea8b#commitcomment-3956440) TimerMilliseconds is now part of the returned JSONObject |
Awesome, just awesome! |
@acuatoria Perhaps you can make doWork just sent a message to the log. And then in: Add the listener and its code. Then from your app start the service and enable the timer and set it to daily. To service would run once a day and send a logcat message. But the listener could be active because of timerenabled. I did not test it, but perhaps it works. But I do not have experience (yet, I need a shake listener) with this construction. |
@acuatoria Never mind. Tested it and it seems to be rather unstable... :) |
@acuatoria Firstly, would you be so kind as to raise a separate issue for this request (this may end up being an enhancement). You are correct that there isn't currently a good way to call the doWork without a timer (it can be done ... but is messy). Under what circumstances would you want to trigger the doWork without a Timer? I think I may need to amend the base code to allow doWork to be called by both a timer and on demand. |
@Red-Folder @acuatoria I opened one: #14 |
First of all, thanks for this awesome plugin.
As requested I raise this "issue" to tackle the following request.
It would be nice to get the current interval timer of the service. Perhaps a bit same construction like the configuration.
Hope to see this feature in a future release.
Thanks again.
The text was updated successfully, but these errors were encountered: