Sfoglia il codice sorgente

fix checkMultiple handling of permissions with type on iOS

erezrokah 7 anni fa
parent
commit
f2f387bc8a
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3
    1
      index.ios.js

+ 3
- 1
index.ios.js Vedi File

@@ -39,6 +39,8 @@ class ReactNativePermissions {
39 39
   	if (!RNPTypes.includes(permission)) {
40 40
 			return Promise.reject(`ReactNativePermissions: ${permission} is not a valid permission type on iOS`);
41 41
 		}
42
+				
43
+		type = type || DEFAULTS[permission]
42 44
 		
43 45
 		return RNPermissions.getPermissionStatus(permission, type);
44 46
 	}
@@ -58,7 +60,7 @@ class ReactNativePermissions {
58 60
 	}
59 61
 
60 62
 	checkMultiple(permissions) {
61
-		return Promise.all(permissions.map(this.check.bind(this)))
63
+		return Promise.all(permissions.map(permission => this.check(permission)))
62 64
 			.then(res => res.reduce((pre, cur, i) => {
63 65
 				var name = permissions[i]
64 66
 				pre[name] = cur