Charles Jeremy Colnet
Charles Jeremy Colnet

Reputation: 71

Cordova CLI 6.3.0 window.plugins undefined

I am compiling through build.phonegap.com I am using CLI 6.3.0

In my index.html I have

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

in my code I have this

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


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

both are undefined.

thanks

Upvotes: 1

Views: 125

Answers (1)

Anuj.T
Anuj.T

Reputation: 1618

You have to write the for specific plugin. i.e for push plugin your have to write :-

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

Upvotes: 1

Related Questions