diff --git a/Boxcar.js b/Boxcar.js index 50cdb86..239203d 100644 --- a/Boxcar.js +++ b/Boxcar.js @@ -297,10 +297,18 @@ var Boxcar = { if (fromNotificationClick && _this.onnotificationclick) _this.onnotificationclick(msg); }, function() { - if (_this.onalert) - _this.onalert(msg) - if (fromNotificationClick && _this.onnotificationclick) + /** + Fire twice ?!?!?! + */ + // if (_this.onalert) + // _this.onalert(msg) + // if (fromNotificationClick && _this.onnotificationclick) + // _this.onnotificationclick(msg); + if( fromNotificationClick && _this.onnotificationclick ){ _this.onnotificationclick(msg); + }else if (_this.onalert) { + _this.onalert(msg) + } }); }, @@ -493,7 +501,7 @@ var Boxcar = { window.plugins.pushNotification.setApplicationIconBadgeNumber(function(){}, function(){}, msg.badge); }catch(ex){console.info("EX ", ex)} - Boxcar._gotMessage(msg, !data.foreground); + Boxcar._gotMessage(msg, !Number(data.foreground)); } }; diff --git a/plugin.xml b/plugin.xml index eede47c..47643b8 100644 --- a/plugin.xml +++ b/plugin.xml @@ -6,27 +6,28 @@ BoxcarPlugin Pawel Chmielowski - + Boxcar push platfrom access plugin for Android and iOS. MIT - + - - + + - + +