Ver código fonte

fix for iOS 8: includes is undefined

king6cong 8 anos atrás
pai
commit
d9ba82cc2c
1 arquivos alterados com 5 adições e 5 exclusões
  1. 5
    5
      ReactNativePermissions.ios.js

+ 5
- 5
ReactNativePermissions.ios.js Ver arquivo

@@ -13,7 +13,7 @@ const RNPTypes = [
13 13
 	'reminder',
14 14
 	'bluetooth',
15 15
 	'notification',
16
-	'backgroundRefresh', 
16
+	'backgroundRefresh',
17 17
 ]
18 18
 
19 19
 class ReactNativePermissions {
@@ -45,8 +45,8 @@ class ReactNativePermissions {
45 45
 		return RNPTypes;
46 46
 	}
47 47
 
48
-	getPermissionStatus(permission) {
49
-		if (RNPTypes.includes(permission)) {
48
+        getPermissionStatus(permission) {
49
+		if (permission in RNPTypes) {
50 50
 			return RNPermissions.getPermissionStatus(permission)
51 51
 		} else {
52 52
 			return Promise.reject(`ReactNativePermissions: ${permission} is not a valid permission type`)
@@ -88,7 +88,7 @@ class ReactNativePermissions {
88 88
 		function processNext() {
89 89
 			i--
90 90
 			let p = permissions[i]
91
-			
91
+
92 92
 			if (!p) {
93 93
 				return obj
94 94
 			}
@@ -106,4 +106,4 @@ class ReactNativePermissions {
106 106
 	}
107 107
 }
108 108
 
109
-module.exports = new ReactNativePermissions()
109
+module.exports = new ReactNativePermissions()