Reputation: 71
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
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