File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
android/capacitor/src/main/java/com/getcapacitor/plugin Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -73,18 +73,20 @@ public void schedule(PluginCall call) {
73
73
return ;
74
74
}
75
75
JSONArray ids = manager .schedule (call , localNotifications );
76
- notificationStorage .appendNotificationIds (localNotifications );
77
- JSObject result = new JSObject ();
78
- JSArray jsArray = new JSArray ();
79
- for (int i =0 ; i < ids .length (); i ++) {
80
- try {
81
- JSObject notification = new JSObject ().put ("id" , ids .getString (i ));
82
- jsArray .put (notification );
83
- } catch (Exception ex ) {
76
+ if (ids != null ) {
77
+ notificationStorage .appendNotificationIds (localNotifications );
78
+ JSObject result = new JSObject ();
79
+ JSArray jsArray = new JSArray ();
80
+ for (int i =0 ; i < ids .length (); i ++) {
81
+ try {
82
+ JSObject notification = new JSObject ().put ("id" , ids .getString (i ));
83
+ jsArray .put (notification );
84
+ } catch (Exception ex ) {
85
+ }
84
86
}
87
+ result .put ("notifications" , jsArray );
88
+ call .success (result );
85
89
}
86
- result .put ("notifications" , jsArray );
87
- call .success (result );
88
90
}
89
91
90
92
@ PluginMethod ()
You can’t perform that action at this time.
0 commit comments