Loading src/android/LocalNotification.java +17 −7 Changes for src/android/LocalNotification.java: 17 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -43,21 +43,19 @@ public class LocalNotification extends CordovaPlugin { @Override public boolean execute (String action, JSONArray args, CallbackContext callbackContext) throws JSONException { JSONObject arguments = args.getJSONObject(0); LocalNotificationOptions options = new LocalNotificationOptions(arguments); String alarmId = options.getId(); rememberCordovaVarsForStaticUse(); if (action.equalsIgnoreCase("add")) { persist(alarmId, args); add(options); addWithoutBlocking(args); return true; } if (action.equalsIgnoreCase("cancel")) { JSONObject arguments = args.getJSONObject(0); LocalNotificationOptions options = new LocalNotificationOptions(arguments); String alarmId = options.getId(); cancel(alarmId); unpersist(alarmId); Loading @@ -75,6 +73,18 @@ public class LocalNotification extends CordovaPlugin { return false; } private static void addWithoutBlocking (final JSONArray args) { cordova.getThreadPool().execute(new Runnable() { public void run() { JSONObject arguments = args.optJSONObject(0); LocalNotificationOptions options = new LocalNotificationOptions(arguments); persist(options.getId(), args); add(options); } }); } /** * Set an alarm * Loading Loading
src/android/LocalNotification.java +17 −7 Changes for src/android/LocalNotification.java: 17 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -43,21 +43,19 @@ public class LocalNotification extends CordovaPlugin { @Override public boolean execute (String action, JSONArray args, CallbackContext callbackContext) throws JSONException { JSONObject arguments = args.getJSONObject(0); LocalNotificationOptions options = new LocalNotificationOptions(arguments); String alarmId = options.getId(); rememberCordovaVarsForStaticUse(); if (action.equalsIgnoreCase("add")) { persist(alarmId, args); add(options); addWithoutBlocking(args); return true; } if (action.equalsIgnoreCase("cancel")) { JSONObject arguments = args.getJSONObject(0); LocalNotificationOptions options = new LocalNotificationOptions(arguments); String alarmId = options.getId(); cancel(alarmId); unpersist(alarmId); Loading @@ -75,6 +73,18 @@ public class LocalNotification extends CordovaPlugin { return false; } private static void addWithoutBlocking (final JSONArray args) { cordova.getThreadPool().execute(new Runnable() { public void run() { JSONObject arguments = args.optJSONObject(0); LocalNotificationOptions options = new LocalNotificationOptions(arguments); persist(options.getId(), args); add(options); } }); } /** * Set an alarm * Loading