Skip to content

Commit ee55293

Browse files
committed
Android notification fix
* Fixed issue #1 where notifications would not always show in the background. - Updated native Android native SDK to version 1.9.2
1 parent 0f8bb54 commit ee55293

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

Example/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
OneSignal Example App.
66
</description>
77
<author email="[email protected]" href="https://onesignal.com">
8-
Apache Cordova Team
8+
OneSignal Team
99
</author>
1010
<content src="index.html" />
1111
<access origin="*" />

Example/www/OneSignal.js

+32-7
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,40 @@ OneSignal.prototype.enableSound = function(enable) {
8484
cordova.exec(function(){}, function(){}, "OneSignalPush", "enableSound", [enable]);
8585
};
8686

87+
OneSignal.prototype.enableNotificationsWhenActive = function(enable) {
88+
cordova.exec(function(){}, function(){}, "OneSignalPush", "enableNotificationsWhenActive", [enable]);
89+
};
90+
91+
OneSignal.prototype.enableInAppAlertNotification = function(enable) {
92+
cordova.exec(function(){}, function(){}, "OneSignalPush", "enableInAppAlertNotification", [enable]);
93+
};
94+
95+
OneSignal.prototype.setSubscription = function(enable) {
96+
cordova.exec(function(){}, function(){}, "OneSignalPush", "setSubscription", [enable]);
97+
};
98+
99+
OneSignal.prototype.postNotification = function(jsonData, onSuccess, onFailure) {
100+
if (onSuccess == null)
101+
onSuccess = function() {};
102+
103+
if (onFailure == null)
104+
onFailure = function() {};
105+
106+
cordova.exec(onSuccess, onFailure, "OneSignalPush", "postNotification", [jsonData]);
107+
};
108+
109+
OneSignal.prototype.setLogLevel = function(logLevel) {
110+
cordova.exec(function(){}, function(){}, "OneSignalPush", "setLogLevel", [logLevel]);
111+
};
112+
113+
87114
//-------------------------------------------------------------------
88115

89-
if(!window.plugins) {
116+
if(!window.plugins)
90117
window.plugins = {};
91-
}
92-
if (!window.plugins.OneSignal) {
118+
119+
if (!window.plugins.OneSignal)
93120
window.plugins.OneSignal = new OneSignal();
94-
}
95121

96-
if (typeof module != 'undefined' && module.exports) {
97-
module.exports = OneSignal;
98-
}
122+
if (typeof module != 'undefined' && module.exports)
123+
module.exports = OneSignal;

plugin.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
id="com.onesignal.plugins.OneSignal"
5-
version="1.6.0">
5+
version="1.6.1">
66

77
<name>OneSignal Push Notifications</name>
88
<author>Josh Kasten</author>

src/android/libs/OneSignalSDK.jar

17 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)