title: Cordova Android- Keep sending AJAX request to the server while the device is in background mode
body: <p>I need to keep performing Ajax request to the server even if the device is in background, I’ve tried the “cordova-plugin-background-mode “ <a href="https://github.com/katzer/cordova-plugin-background-mode" rel="nofollow noreferrer">https://github.com/katzer/cordova-plugin-background-mode</a> ,
  Please see the code below ,but for some reason it doesn’t work</p>
  
  <p>Any help would be appreciated to solve this problem</p>
  
  <pre><code>cordova.plugins.backgroundMode.on('activate', function (){
    window.setInterval(function () {
      //Ajax request every 6 S
      }, 6000)
  });
  </code></pre>