|
@@ -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
|