Skip to content

Commit

Permalink
Android notification fix
Browse files Browse the repository at this point in the history
* Fixed issue #1 where notifications would not always show in the background.
  - Updated native Android native SDK to version 1.9.2
  • Loading branch information
jkasten2 committed Jun 12, 2015
1 parent 0f8bb54 commit ee55293
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Example/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
OneSignal Example App.
</description>
<author email="[email protected]" href="https://onesignal.com">
Apache Cordova Team
OneSignal Team
</author>
<content src="index.html" />
<access origin="*" />
Expand Down
39 changes: 32 additions & 7 deletions Example/www/OneSignal.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,40 @@ OneSignal.prototype.enableSound = function(enable) {
cordova.exec(function(){}, function(){}, "OneSignalPush", "enableSound", [enable]);
};

OneSignal.prototype.enableNotificationsWhenActive = function(enable) {
cordova.exec(function(){}, function(){}, "OneSignalPush", "enableNotificationsWhenActive", [enable]);
};

OneSignal.prototype.enableInAppAlertNotification = function(enable) {
cordova.exec(function(){}, function(){}, "OneSignalPush", "enableInAppAlertNotification", [enable]);
};

OneSignal.prototype.setSubscription = function(enable) {
cordova.exec(function(){}, function(){}, "OneSignalPush", "setSubscription", [enable]);
};

OneSignal.prototype.postNotification = function(jsonData, onSuccess, onFailure) {
if (onSuccess == null)
onSuccess = function() {};

if (onFailure == null)
onFailure = function() {};

cordova.exec(onSuccess, onFailure, "OneSignalPush", "postNotification", [jsonData]);
};

OneSignal.prototype.setLogLevel = function(logLevel) {
cordova.exec(function(){}, function(){}, "OneSignalPush", "setLogLevel", [logLevel]);
};


//-------------------------------------------------------------------

if(!window.plugins) {
if(!window.plugins)
window.plugins = {};
}
if (!window.plugins.OneSignal) {

if (!window.plugins.OneSignal)
window.plugins.OneSignal = new OneSignal();
}

if (typeof module != 'undefined' && module.exports) {
module.exports = OneSignal;
}
if (typeof module != 'undefined' && module.exports)
module.exports = OneSignal;
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.onesignal.plugins.OneSignal"
version="1.6.0">
version="1.6.1">

<name>OneSignal Push Notifications</name>
<author>Josh Kasten</author>
Expand Down
Binary file modified src/android/libs/OneSignalSDK.jar
Binary file not shown.

0 comments on commit ee55293

Please sign in to comment.