Browse Source

fix for iOS 8: includes is undefined

king6cong 8 years ago
parent
commit
d9ba82cc2c
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      ReactNativePermissions.ios.js

+ 5
- 5
ReactNativePermissions.ios.js View File

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