瀏覽代碼

Only add platform specific properties if required.

Sebastián Katzer 12 年之前
父節點
當前提交
8e8546c07d
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      www/local-notification.js

+ 11 - 2
www/local-notification.js

@@ -25,12 +25,21 @@ LocalNotification.prototype = {
             title:      '',
             badge:      0,
             id:         0,
-            icon:       'icon', // nur Android
-            sound:      '', // nur iOS
             background: '',
             foreground: ''
         };
 
+        switch (device.platform) {
+            case 'Android':
+                defaults.icon = 'icon'; break;
+            case 'iOS':
+                defaults.sound = ''; break;
+            case 'WinCE': case 'Win32NT':
+                defaults.smallImage = null;
+                defaults.image = null;
+                defaults.wideImage = null;
+        };
+
         var callbackFn = function (cmd) {
             eval(cmd);
         };