Explorar o código

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

Brian Keith Smith %!s(int64=10) %!d(string=hai) anos
pai
achega
80dc6caa54
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  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;
 };