Commit 14dfd156 by Sebastián Katzer

Small code changes

parent cbf00120
...@@ -87,7 +87,7 @@ public class LocalNotification extends CordovaPlugin { ...@@ -87,7 +87,7 @@ public class LocalNotification extends CordovaPlugin {
cancel(id); cancel(id);
unpersist(id); unpersist(id);
execCallback(command); command.success();
} }
}); });
} }
...@@ -97,7 +97,7 @@ public class LocalNotification extends CordovaPlugin { ...@@ -97,7 +97,7 @@ public class LocalNotification extends CordovaPlugin {
public void run() { public void run() {
cancelAll(); cancelAll();
unpersistAll(); unpersistAll();
execCallback(command); command.success();
} }
}); });
} }
...@@ -227,13 +227,13 @@ public class LocalNotification extends CordovaPlugin { ...@@ -227,13 +227,13 @@ public class LocalNotification extends CordovaPlugin {
* The notification ID to be check. * The notification ID to be check.
* @param callbackContext * @param callbackContext
*/ */
public static void isScheduled (String id, CallbackContext callbackContext) { public static void isScheduled (String id, CallbackContext command) {
SharedPreferences settings = getSharedPreferences(); SharedPreferences settings = getSharedPreferences();
Map<String, ?> alarms = settings.getAll(); Map<String, ?> alarms = settings.getAll();
boolean isScheduled = alarms.containsKey(id); boolean isScheduled = alarms.containsKey(id);
PluginResult result = new PluginResult(PluginResult.Status.OK, isScheduled); PluginResult result = new PluginResult(PluginResult.Status.OK, isScheduled);
callbackContext.sendPluginResult(result); command.sendPluginResult(result);
} }
/** /**
...@@ -241,13 +241,13 @@ public class LocalNotification extends CordovaPlugin { ...@@ -241,13 +241,13 @@ public class LocalNotification extends CordovaPlugin {
* *
* @param callbackContext * @param callbackContext
*/ */
public static void getScheduledIds (CallbackContext callbackContext) { public static void getScheduledIds (CallbackContext command) {
SharedPreferences settings = getSharedPreferences(); SharedPreferences settings = getSharedPreferences();
Map<String, ?> alarms = settings.getAll(); Map<String, ?> alarms = settings.getAll();
Set<String> alarmIds = alarms.keySet(); Set<String> alarmIds = alarms.keySet();
JSONArray pendingIds = new JSONArray(alarmIds); JSONArray pendingIds = new JSONArray(alarmIds);
callbackContext.success(pendingIds); command.success(pendingIds);
} }
/** /**
...@@ -295,13 +295,6 @@ public class LocalNotification extends CordovaPlugin { ...@@ -295,13 +295,6 @@ public class LocalNotification extends CordovaPlugin {
} }
/** /**
* Simply invokes the callback without any parameter.
*/
private static void execCallback (CallbackContext command) {
command.sendPluginResult(new PluginResult(PluginResult.Status.OK));
}
/**
* Fires the given event. * Fires the given event.
* *
* @param {String} event The Name of the event * @param {String} event The Name of the event
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment