Phonegap background plugin not calling function


i have been searching on web solution problem, thing found, people same issue have. using this plugin supposedly has ability keep running functions when app in background mode, want simple ajax function called every 1 minute in background. implementation seems simple, there function not working, code:

 

ondeviceready: function()
{
  console.log('ondeviceready start');

  // prevent app going sleep in background
  cordova.plugins.backgroundmode.setdefaults({ text:'em background.'});
  // enable background mode
  cordova.plugins.backgroundmode.enable();

  // called when background mode has been activated
  cordova.plugins.backgroundmode.onactivate = function ()
  {
  function not work, simple console.log doesn´t anything.
  }
},

 

i´m using weinre see happens after compile code in phonegap build, thing can control cordova.plugins.backgroundmode.setdefaults({ text:'em background.'}); function. enter app, , hit home button, , there´s little notification on top says "the app in background", setdefaults text appears , that´s it!!. have seen lot of people same problem in exact same function.

does came across problem? appreciated.

regards

i suggest contacting plugin author.

 

fyi -- if app destined app store, will app rejected.



More discussions in PhoneGap Build


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop