1

Ich Kompilieren durch build.phonegap.com Ich bin mit CLI 6.3.0Cordova CLI 6.3.0 window.plugins undefined

In meiner index.html Ich habe

<script type="text/javascript" src="cordova.js"></script>

in Mein Code Ich habe dies

document.addEventListener("deviceready", onDeviceReady, false); 


onDeviceReady = function() { 
    alert(window.plugins); 
    alert("try 2"); 
    alert(cordova.plugins); } 

beide sind undefiniert.

danke

+0

Was Sie erreichen möchten? –

Antwort

1

Sie müssen das für spezifische Plugin schreiben. für Push-Plugin müssen Sie schreiben: -

var pushNotification; 
document.addEventListener("deviceready", function(){ 
    pushNotification = window.plugins.pushNotification; 
}); 
Verwandte Themen