소스 검색

Merge pull request #804 from thisisbrians/expect-every-option-to-be-string-on-ios

Force `every:` to be a string on iOS and display a warning if not
Sebastián Katzer 10 년 전
부모
커밋
652535e5c5
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;
 };