2016-04-07 9 views
0

Hallo funktioniert ich auf Projekt arbeitete, das Plugin Wakeup-Timer das Problem ist, dass ich von SuccessCallback bekommen (dies ist das erste Argument von Wakeup ist) "Wakeup unhandled Typ" I Verwenden Sie das Github-Plugin https://github.com/wnyc/cordova-plugin-wakeuptimer mein index.html Wo muss ich JS ändern, damit es funktioniert?PhoneGap Build-Code of wakeuptimer Plugin nicht

<!DOCTYPE html> 
<html> 
    <head> 
     <meta charset="UTF-8"> 
     <meta http-equiv="Content-type" content="text/html; charset=utf-8"> 
     <!--<meta name="viewport" ... /> --> 
     <script type="text/javascript" charset="utf-8" src="cordova.js"></script> 
     <script type="text/javascript" charset="utf-8"> 

      function init() { 
       document.addEventListener("deviceready", onDeviceReady, false); 
      } 
      function onDeviceReady() { 
       myDevice = document.getElementById('deviceProperties'); 


       myDevice.innerHTML = window.wakeuptimer.wakeup(function(result) { 
        if (result.type==='wakeup') { 
         alert('wakeup alarm detected--' + result.extra); 
        } else if(result.type==='set'){ 
         alert('wakeup alarm set--' + result); 
        } else { 
         alert('wakeup unhandled type (' + result.type + ')'); 
        } 
       }, function() { 
        alert('Error!'); 
       }, {alarms : [{type : 'onetime', 
        time : { hour : 15, minute : 00 }, 
        extra : { message : 'json containing app-specific information to be posted when alarm triggers' }, 
        message : 'Alarm has expired!'}] 
        } 
); 
     } 






     </script> 
    </head> 

    <body> 
     <h1>Dane z alarmu</h1> 
     <button type="button" id="deviceProperties" onclick="init()">Ustaw alarm</button> 
    </body> 
</html> 

Antwort

0

Version Anforderungen

Dieses Plugin soll mit Cordova arbeiten 3.5.0+.

Ich benutze Version 1 von PGB so ist dieses Zitat eine Antwort