|
@@ -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 {
|
|
|
public void run() {
|
|
public void run() {
|
|
|
cancelAll();
|
|
cancelAll();
|
|
|
unpersistAll();
|
|
unpersistAll();
|
|
|
- execCallback(command);
|
|
|
|
|
|
|
+ command.success();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -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 {
|
|
|
*
|
|
*
|
|
|
* @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);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -294,13 +294,6 @@ public class LocalNotification extends CordovaPlugin {
|
|
|
editor.apply();
|
|
editor.apply();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 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.
|
|
|
*
|
|
*
|