Explorar o código

`cancel` is called with the notification id and not an object.

Sebastián Katzer %!s(int64=12) %!d(string=hai) anos
pai
achega
24d2593e15
Modificáronse 1 ficheiros con 3 adicións e 6 borrados
  1. 3 6
      src/android/LocalNotification.java

+ 3 - 6
src/android/LocalNotification.java

@@ -53,13 +53,10 @@ public class LocalNotification extends CordovaPlugin {
         }
 
         if (action.equalsIgnoreCase("cancel")) {
-            JSONObject arguments             = args.getJSONObject(0);
-            Activity activity                = cordova.getActivity();
-            LocalNotificationOptions options = new LocalNotificationOptions(activity).parse(arguments);
-            String alarmId                   = options.getId();
+            String id = args.optString(0);
 
-            cancel(alarmId);
-            unpersist(alarmId);
+            cancel(id);
+            unpersist(id);
 
             return true;
         }