I'm building a hybrid app using Cordova (version 4.0.0) for Android.
I have added PushPlugin (https://github.com/phonegap-build/PushPlugin) to the project. While registering it goes to errorhandler and displays 'Class not found'.
I have tried various suggestion like
- Added plugin reference in xml. Actually plugin reference is already there in config.xml file.
- Directly install plugin using CLI (tried cordova plugin add https://github.com/phonegap-build/PushPlugin.git as well as cordova plugin add com.phonegap.plugins.pushplugin)
- Create a new project etc.
- PushNotification.js is added in html (
<script type="text/javascript" src="js/PushNotification.js"></script>
) and is located inwww/js/
But still I'm getting the same message 'Class not found'
I have installed supporting plugins like device, file, media that are used by PushPlugin
Please advice if anyone has a solution for this issue.
Code sample:
document.addEventListener("deviceready", onDeviceReady, false);
var pushNotification;
function onDeviceReady() {
//Push notification
pushNotification = window.plugins.pushNotification;
pushNotification.register(successHandler, errorHandler, {"senderID":"xxxxxxxxxx", "ecb":"onNotification"});
}