Skip to content

Javascript Method Reference

Eduardo edited this page Jun 25, 2014 · 3 revisions

The plugin provides various Javascript methods for you to use in your HTML/ Javascript front-end.

All methods attempt to return the following data in both the success and failure callbacks

[startService] (startService)

Method will start the background service.

[stopService] (stopService)

Method will stop the background service.

[enableTimer] (enableTimer)

Method will enable the timer on the background service.

[disableTimer] (disableTimer)

Method will disable the timer on the background service.

[setConfiguration] (setConfiguration) - work?

Method will enable the passing of configuration details from the HTML/ Javascript front-end to the background service.

[registerForBootStart] (registerForBootStart)

Method will enable the background service to start automatically on device boot.

[deregisterForBootStart] (deregisterForBootStart)

Method will disable the background service from starting automatically on device boot.

[getStatus] (getStatus)

Method will get the current status of the background service.

[runOnce] (runOnce)

Method allows the background service logic (doWork) to be run once from the HTML/ Javascript front-end.

[registerForUpdates] (registerForUpdates)

Method allows the HTML/ Javascript front-end to register a handler to be run automatically after the completion of the [doWork] (doWork).

[deregisterForUpdates] (deregisterForUpdates)

Method allows the HTML/ Javascript front-end to de-register a handler to be run automatically after the completion of the [doWork] (doWork).