2016-05-04 20 views
0

wollen app cordova und ionic für android zu alaram in einigen zeiten wie 2:50 und ich will programm laufen lassen selbst schließen das programm ich benutze katzer/cordova-plugin-hintergrund -Mode-Plugin, aber wenn ich Programm zu schließen, sei es in der Nähe und nicht laufen nach wie vor im Hintergrund dieser Code istwie kann ich app erstellen sogar benutzer schließen sie android

// Run when the device is ready 
    document.addEventListener('deviceready', function() { 

     // Android customization 
     // To indicate that the app is executing tasks in background and being paused would disrupt the user. 
     // The plug-in has to create a notification while in background - like a download progress bar. 

     cordova.plugins.backgroundMode.setDefaults({ 
     title: 'TheTitleOfYourProcess', 
     text: 'Executing background tasks.' 
     }); 

     // Enable background mode 
     cordova.plugins.backgroundMode.enable(); 

     // Called when background mode has been activated 
     cordova.plugins.backgroundMode.onactivate = function() { 
     // Set an interval of 3 seconds (3000 milliseconds) 
     setInterval(function() { 
      var dd = new date(); 
      var h = dd.getHours(); 
      var m = dd.getMinutes(); 
      if(h == 2 && m ==50){ 
      alert("2:50"); 
      } 
     }, 3000); 
     } 
    }, false); 

wie kann ich App noch machen laufen sogar Benutzer schließen sie das Programm wie, Wecker oder ein Programm Erinnerung?

Antwort