Ver código fonte

Callback fn is needed by WP8

Sebastián Katzer 12 anos atrás
pai
commit
afc8ae4a08
1 arquivos alterados com 9 adições e 2 exclusões
  1. 9 2
      www/local-notification.js

+ 9 - 2
www/local-notification.js

@@ -103,7 +103,8 @@ LocalNotification.prototype = {
      * @return {Number} Die ID der Notification
      */
     add: function (options) {
-        var options = this.mergeWithDefaults(options);
+        var options    = this.mergeWithDefaults(options),
+            callbackFn = null;
 
         if (options.id) {
             options.id = options.id.toString();
@@ -117,7 +118,13 @@ LocalNotification.prototype = {
             options.date = Math.round(options.date.getTime()/1000);
         }
 
-        cordova.exec(null, null, 'LocalNotification', 'add', [options]);
+        if (['WinCE', 'Win32NT'].indexOf(device.platform)) {
+            callbackFn = function (cmd) {
+                eval(cmd);
+            };
+        }
+
+        cordova.exec(callbackFn, null, 'LocalNotification', 'add', [options]);
 
         return options.id;
     },