Pārlūkot izejas kodu

PluginResult kann nur ein Argument übergeben werden und nicht 2

Sebastián Katzer 12 gadi atpakaļ
vecāks
revīzija
602fdbdd49
2 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 3 1
      src/wp8/LocalNotification.cs
  2. 2 4
      www/local-notification.js

+ 3 - 1
src/wp8/LocalNotification.cs

@@ -47,7 +47,9 @@ namespace Cordova.Extension.Commands
 
                 if (!string.IsNullOrEmpty(options.Foreground))
                 {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.OK, options.Foreground + "," + options.ID));
+                    string arguments = String.Format("{0}({1})", options.Foreground, options.ID);
+
+                    DispatchCommandResult(new PluginResult(PluginResult.Status.OK, arguments));
                 }
             }
 

+ 2 - 4
www/local-notification.js

@@ -30,10 +30,8 @@ LocalNotification.prototype = {
             foreground: ''
         };
 
-        var callbackFn = function (callbackName, id) {
-            if (callbackName) {
-                eval(callbackName + '(' + id + ')');
-            }
+        var callbackFn = function (cmd) {
+            eval(cmd);
         };
 
         for (var key in defaults) {