瀏覽代碼

Merge pull request #27 from evanmrose/master

Fixing issue where Array.includes() is not supported by RN for iOS8. …
Yonah Forst 9 年之前
父節點
當前提交
9306bd737f
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      ReactNativePermissions.js

+ 3 - 3
ReactNativePermissions.js

@@ -66,9 +66,9 @@ class ReactNativePermissions {
 	}
 
 	requestPermission(permission, type) {
-		let options; 
-
-		if (!this.getPermissionTypes().includes(permission)) {
+		let options;
+		
+		if (this.getPermissionTypes().indexOf(permission) === -1) {
 			return Promise.reject(`ReactNativePermissions: ${permission} is not a valid permission type on ${Platform.OS}`)
 		} else if (permission == 'backgroundRefresh'){
 			return Promise.reject('ReactNativePermissions: You cannot request backgroundRefresh')