Created
September 24, 2012 20:48
-
-
Save Red-Folder/3778283 to your computer and use it in GitHub Desktop.
Phonegap Service Tutorial - Part2 - Index.html - enableTimer snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function enableTimer(data) { | |
if (data.TimerEnabled) | |
registerForBootStart(data); | |
else | |
window.plugins.twitterService.enableTimer( 60000, | |
function(r){ registerForBootStart(r) }, | |
function(e){ alert('An error has occurred in enableTimer') }); | |
} | |
function registerForBootStart(data) { | |
if (data.RegisteredForBootStart) | |
alert('Service started, timer enabled and service registered for Boot start'); | |
else | |
window.plugins.twitterService.registerForBootStart( function(r){ alert('Service started, timer enabled and service registered for Boot start') }, | |
function(e){ alert('An error has occurred in registerForBootStart') }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment