Skip to content
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

Keep callback success open. To be callable from doWork() #17

Closed
francoisr opened this issue Oct 15, 2013 · 7 comments
Closed

Keep callback success open. To be callable from doWork() #17

francoisr opened this issue Oct 15, 2013 · 7 comments
Assignees

Comments

@francoisr
Copy link

As you suggested to me elsewhere (http://red-folder.blogspot.com.es/2012/09/phonegap-service-tutorial-part-3.html, comments), I think the ability to call back the success function from doWork could be beneficial to integrate the service. The need for a set interval in the cordova app would be eliminated. This would be in line with the pattern used elsewhere, cf http://stackoverflow.com/questions/7751522/android-phonegap-notify-javascript-when-an-asynctask-is-finished.

I'm not clear on the impact of the client app being killed by Android as it goes out of focus a new instance of the client connecting again.

Regards

@Red-Folder
Copy link
Owner

Notes for development;

Would plan to create registerForUpdates and deregisterForUpdates JS methods.

The registerForUpdates would accept a JS callback to be used off the back of the doWork listener. Some conversation on keeping the callback open here -> http://stackoverflow.com/questions/7751522/android-phonegap-notify-javascript-when-an-asynctask-is-finished

I assume I should be able to call success multiple times as long as I keep the pluginResult.setKeepCallback true

Will need to test it

@Red-Folder
Copy link
Owner

Update:

Code drafted. Interface added for Cordova 3.1 - need to added to test spec.

Will need to validate if approach will work for previous Cordova versions before release

@ghost ghost assigned Red-Folder Nov 7, 2013
@Red-Folder
Copy link
Owner

Committed code for Cordova 3.1.0 version - Commit 0e3a990

Will update & upload version by version over the next few days. Note sure at this stage if I'll be able to support all versions.

@Red-Folder
Copy link
Owner

Quick update; version 2.2.0 through to 3.0.0 have been built and tested. I'll probably be able to update to the repo tonight.

@Red-Folder
Copy link
Owner

All versions now uploaded (commit ac9f989)

Any problems, please log issue as normal

@vladjiss
Copy link

Please help me, I have a error: Error: Plugin unable to bind to background servace
ErrorCode: -4 ...
I do everything according to instructions.
http://zalivalka.ru/79472
Who has a working source code, send me please danreegly@gmail.com

@Red-Folder
Copy link
Owner

@vladjiss Please stop adding comments to existing issues. The issue should be kept on topic. Please create a new issue and provide a copy of your code so that I can assist. It will almost certainly be because you have missed a step in the instructions - which I'm prepared to help with, but please stop spamming the issues list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants