Pārlūkot izejas kodu

Merge pull request #14 from king6cong/iOS8-fix

support pre-ES7 (includes is undefined)
Yonah Forst 8 gadus atpakaļ
vecāks
revīzija
0bdbe7e5b1
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5
    5
      ReactNativePermissions.ios.js

+ 5
- 5
ReactNativePermissions.ios.js Parādīt failu

@@ -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 (RNPTypes.indexOf(permission) >= 0) {
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()