瀏覽代碼

Merge pull request #27 from evanmrose/master

Fixing issue where Array.includes() is not supported by RN for iOS8. …
Yonah Forst 8 年之前
父節點
當前提交
9306bd737f
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      ReactNativePermissions.js

+ 3
- 3
ReactNativePermissions.js 查看文件

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