Browse Source

Merge pull request #27 from evanmrose/master

Fixing issue where Array.includes() is not supported by RN for iOS8. …
Yonah Forst 9 năm trước cách đây
mục cha
commit
9306bd737f
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  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')