Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ios notification when app was in background #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Boxcar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
});
},

Expand Down Expand Up @@ -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));
}
};

Expand Down
11 changes: 6 additions & 5 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@

<name>BoxcarPlugin</name>
<author>Pawel Chmielowski</author>

<description>
Boxcar push platfrom access plugin for Android and iOS.
</description>

<license>MIT</license>

<js-module src="Boxcar.js" name="Boxcar">
<clobbers target="Boxcar" />
</js-module>

<engines>
<engine name="cordova" version=">=3.1.0" />
</engines>
</engines>

<!-- android -->
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<plugin name="Storage" value="org.apache.cordova.Storage"/>
</config-file>
</platform>
<dependency id="org.apache.cordova.device" url="git://git.apache.org/cordova-plugin-device.git" commit="master"/>


<dependency id="com.phonegap.plugins.PushPlugin" url="https://github.com/boxcar/PushPlugin" commit="master"/>
</plugin>