@@ -84,15 +84,40 @@ OneSignal.prototype.enableSound = function(enable) {
84
84
cordova . exec ( function ( ) { } , function ( ) { } , "OneSignalPush" , "enableSound" , [ enable ] ) ;
85
85
} ;
86
86
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
+
87
114
//-------------------------------------------------------------------
88
115
89
- if ( ! window . plugins ) {
116
+ if ( ! window . plugins )
90
117
window . plugins = { } ;
91
- }
92
- if ( ! window . plugins . OneSignal ) {
118
+
119
+ if ( ! window . plugins . OneSignal )
93
120
window . plugins . OneSignal = new OneSignal ( ) ;
94
- }
95
121
96
- if ( typeof module != 'undefined' && module . exports ) {
97
- module . exports = OneSignal ;
98
- }
122
+ if ( typeof module != 'undefined' && module . exports )
123
+ module . exports = OneSignal ;
0 commit comments