I need to implement PubNub pushnotification in my MobileFirst project.
For that implementation i done the following things.
In my android native folder :assets->www->default->worklight->cordova_plugins.js
Here I added the following code
{
"file": "plugins/org.apache.cordova.pushnotification/www/pushnotification.js",
"merges": [
"window.plugins.pushNotification"
]
}
In android native folder assets->www->default->js->main.js file i added the following code
var pushNotification = window.plugins.pushNotification;
pushNotification.register(
successHandler,
errorHandler,
{
'senderID':'projectID'
}
);
function successHandler(result) {
alert('Success: '+ result);
}
function errorHandler(error) {
alert('Error: '+ error);
}
And I run this code on my android device. When I inspect my android device. i am getting the following error on my concole
Uncaught Error: Module undefined does not exist. in cordova.js file
Is this cordova plugin issue?
How can I configure cordova plugin in MobileFirst project?
Please suggest..