@@ -33,6 +33,8 @@ public class LocalNotification {
33
33
private String actionTypeId ;
34
34
private String group ;
35
35
private boolean groupSummary ;
36
+ private boolean ongoing ;
37
+ private boolean autoCancel ;
36
38
private JSObject extra ;
37
39
private List <LocalNotificationAttachment > attachments ;
38
40
private LocalNotificationSchedule schedule ;
@@ -152,6 +154,22 @@ public void setGroupSummary(boolean groupSummary) {
152
154
this .groupSummary = groupSummary ;
153
155
}
154
156
157
+ public boolean isOngoing () {
158
+ return ongoing ;
159
+ }
160
+
161
+ public void setOngoing (boolean ongoing ) {
162
+ this .ongoing = ongoing ;
163
+ }
164
+
165
+ public boolean isAutoCancel () {
166
+ return autoCancel ;
167
+ }
168
+
169
+ public void setAutoCancel (boolean autoCancel ) {
170
+ this .autoCancel = autoCancel ;
171
+ }
172
+
155
173
public String getChannelId () {
156
174
return channelId ;
157
175
}
@@ -186,7 +204,7 @@ public static List<LocalNotification> buildNotificationList(PluginCall call) {
186
204
call .error ("Invalid JSON object sent to NotificationPlugin" , e );
187
205
return null ;
188
206
}
189
-
207
+
190
208
try {
191
209
LocalNotification activeLocalNotification = buildNotificationFromJSObject (notification );
192
210
resultLocalNotifications .add (activeLocalNotification );
@@ -214,6 +232,8 @@ public static LocalNotification buildNotificationFromJSObject(JSObject jsonObjec
214
232
localNotification .setChannelId (jsonObject .getString ("channelId" ));
215
233
localNotification .setSchedule (new LocalNotificationSchedule (jsonObject ));
216
234
localNotification .setExtra (jsonObject .getJSObject ("extra" ));
235
+ localNotification .setOngoing (jsonObject .getBoolean ("ongoing" , false ));
236
+ localNotification .setAutoCancel (jsonObject .getBoolean ("autoCancel" , true ));
217
237
218
238
return localNotification ;
219
239
}
@@ -288,6 +308,8 @@ public String toString() {
288
308
", attachments=" + attachments +
289
309
", schedule=" + schedule +
290
310
", groupSummary=" + groupSummary +
311
+ ", ongoing=" + ongoing +
312
+ ", autoCancel=" + autoCancel +
291
313
'}' ;
292
314
}
293
315
@@ -311,6 +333,8 @@ public boolean equals(Object o) {
311
333
if (attachments != null ? !attachments .equals (that .attachments ) : that .attachments != null )
312
334
return false ;
313
335
if (groupSummary != that .groupSummary ) return false ;
336
+ if ( ongoing != that .ongoing ) return false ;
337
+ if ( autoCancel != that .autoCancel ) return false ;
314
338
return schedule != null ? schedule .equals (that .schedule ) : that .schedule == null ;
315
339
}
316
340
@@ -325,6 +349,8 @@ public int hashCode() {
325
349
result = 31 * result + (actionTypeId != null ? actionTypeId .hashCode () : 0 );
326
350
result = 31 * result + (group != null ? group .hashCode () : 0 );
327
351
result = 31 * result + Boolean .hashCode (groupSummary );
352
+ result = 31 * result + Boolean .hashCode ( ongoing );
353
+ result = 31 * result + Boolean .hashCode ( autoCancel );
328
354
result = 31 * result + (extra != null ? extra .hashCode () : 0 );
329
355
result = 31 * result + (attachments != null ? attachments .hashCode () : 0 );
330
356
result = 31 * result + (schedule != null ? schedule .hashCode () : 0 );
0 commit comments