Skip to content

Instantly share code, notes, and snippets.

@Red-Folder
Created September 24, 2012 20:48
Show Gist options
  • Save Red-Folder/3778283 to your computer and use it in GitHub Desktop.
Save Red-Folder/3778283 to your computer and use it in GitHub Desktop.
Phonegap Service Tutorial - Part2 - Index.html - enableTimer snippet
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