瀏覽代碼

expect the every option to always be a string on iOS. display a warning if it is not.

Brian Keith Smith 10 年之前
父節點
當前提交
80dc6caa54
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      www/local-notification-util.js

+ 10 - 0
www/local-notification-util.js

@@ -172,6 +172,16 @@ exports.convertProperties = function (options) {
         options.data = JSON.stringify(options.data);
     }
 
+    if (options.every)
+        if (device.platform == 'iOS' && typeof options.every != 'string') {
+            options.every = this.getDefaults().every;
+            var warning = 'Every option is not a string: ' + options.id;
+            warning += '. Expects one of: second, minute, hour, day, week, ';
+            warning += 'month, year on iOS.';
+            console.warn(warning);
+        }
+    }
+
     return options;
 };