I am trying to set up a push notification with parse to handle received notifications.
I used https://github.com/avivais/phonegap-parse-plugin plugin and was able to set it up correctly.
But my problem with it is that i cannot handle received notifications. to redirect a user to a the page if the notification based on the notification json params.
So i decided to switch to https://github.com/manishiitg/parse-push-plugin and my problem with it is that i cannot even get it to show the alert registered box, it cannot even find the ParsePushPlugin method.
I followed the tutorial which is simple enough and added this to my app.js file
ParsePushPlugin.register({
appId:"xxx", clientKey:"xxx", eventKey:"myEventKey"}, //will trigger receivePN[pnObj.myEventKey]
function() {
alert('successfully registered device!');
}, function(e) {
alert('error registering device: ' + e);
});
ParsePushPlugin.on('receivePN', function(pn){
alert('yo i got this push notification:' + JSON.stringify(pn));
});
The alert success just failed to show so i guess its not working or i am not doing the right thing.