I have successfully implement the push notification using (https://github.com/phonegap-build/PushPlugin) in cordova.Everthing works correctly except that push notification is not showing when the app is running(ie foreground).Here is the code
case 'message':
// if this flag is set, this notification happened while we were in the foreground.
// you might want to play a sound to get the user's attention, throw up a dialog, etc.
if ( e.foreground )
{
// if this flag is set, this notification happened while we were in the foreground.
//this is not working
if(e.foreground){
var myMedia = new Media("/assets/www/img/beep.mp3");
my_media.play();
}else{
// otherwise we were launched because the user touched a notification in the notification tray.
}
break;