From d3dd9f07b7765f460a0fa33767e5fc7b7ca81ab7 Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Sun, 22 Feb 2015 21:57:37 +0100 Subject: [PATCH] #3 JSON parse error --- plugin.xml | 2 +- src/android/LocalNotification.java | 74 +++++++++++++++--------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/plugin.xml b/plugin.xml index b666511cb..2faf955d4 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ + version="0.8.0dev3"> LocalNotification diff --git a/src/android/LocalNotification.java b/src/android/LocalNotification.java index 3a99a396c..e84b90f86 100644 --- a/src/android/LocalNotification.java +++ b/src/android/LocalNotification.java @@ -62,7 +62,7 @@ public class LocalNotification extends CordovaPlugin { Asset asset; Manager manager; NotificationWrapper nWrapper; - + @Override public void initialize (CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); @@ -76,16 +76,16 @@ public void initialize (CordovaInterface cordova, CordovaWebView webView) { } @Override public boolean execute (String action, final JSONArray args, final CallbackContext command) throws JSONException { - + if (action.equalsIgnoreCase("add")) { cordova.getThreadPool().execute( new Runnable() { - public void run() { + public void run() { add(args); command.success(); } }); } - + if (action.equalsIgnoreCase("update")) { cordova.getThreadPool().execute( new Runnable() { public void run() { @@ -94,13 +94,13 @@ public void run() { } }); } - + if (action.equalsIgnoreCase("cancel")) { cordova.getThreadPool().execute( new Runnable() { public void run() { cancel(args); command.success(); - + } }); } @@ -113,7 +113,7 @@ public void run() { } }); } - + if (action.equalsIgnoreCase("clear")) { cordova.getThreadPool().execute( new Runnable() { public void run() { @@ -122,7 +122,7 @@ public void run() { } }); } - + if (action.equalsIgnoreCase("clearAll")) { cordova.getThreadPool().execute( new Runnable() { public void run() { @@ -134,18 +134,18 @@ public void run() { if (action.equalsIgnoreCase("isScheduled")) { String id = args.optString(0); - boolean isScheduled = manager.isScheduled(id); + boolean isScheduled = manager.isScheduled(id); PluginResult result = new PluginResult(PluginResult.Status.OK, (isScheduled)); command.sendPluginResult(result); } - + if (action.equalsIgnoreCase("isTriggered")) { String id = args.optString(0); boolean isTriggered = manager.isTriggered(id); PluginResult result = new PluginResult(PluginResult.Status.OK, isTriggered); command.sendPluginResult(result); } - + if (action.equalsIgnoreCase("exist")) { String id = args.optString(0); boolean exist = manager.exist(id); @@ -162,12 +162,12 @@ public void run() { JSONArray triggeredIds = manager.getTriggeredIds(); command.success(triggeredIds); } - + if (action.equalsIgnoreCase("getAllIds")) { JSONArray allIds = manager.getAllIds(); command.success(allIds); } - + if (action.equalsIgnoreCase("getAll")) { JSONArray ids; JSONArray all; @@ -179,7 +179,7 @@ public void run() { } command.success(all); } - + if (action.equalsIgnoreCase("getTriggered")) { JSONArray ids; JSONArray triggered; @@ -191,7 +191,7 @@ public void run() { } command.success(triggered); } - + if (action.equalsIgnoreCase("getScheduled")) { JSONArray ids; JSONArray scheduled; @@ -222,8 +222,8 @@ public void run() { return true; } - - + + //------------------------------------------------exec-Functions----------------------------------------------- /** * Schedule notifications contained in the args-Array @@ -240,9 +240,9 @@ private void add(JSONArray args){ nWrapper.schedule(options); JSONArray fireData= new JSONArray().put(options.getJSONObject()); fireEvent("add", options.getId(),options.getJSON(), fireData); - } + } } - + /** * Update existing notifications * @param args @@ -252,11 +252,11 @@ private void update(JSONArray args){ JSONObject updateContent; for(int i=0;i