|
@@ -36,7 +36,10 @@ class ReactNativePermissions {
|
36
|
36
|
)
|
37
|
37
|
}
|
38
|
38
|
|
39
|
|
- return PermissionsIOS.getPermissionStatus(permission, type)
|
|
39
|
+ return PermissionsIOS.getPermissionStatus(
|
|
40
|
+ permission,
|
|
41
|
+ type || DEFAULTS[permission],
|
|
42
|
+ )
|
40
|
43
|
}
|
41
|
44
|
|
42
|
45
|
request = (permission, type) => {
|
|
@@ -61,13 +64,14 @@ class ReactNativePermissions {
|
61
|
64
|
}
|
62
|
65
|
|
63
|
66
|
checkMultiple = permissions =>
|
64
|
|
- Promise.all(permissions.map(this.check)).then(result =>
|
65
|
|
- result.reduce((acc, value, index) => {
|
66
|
|
- const name = permissions[index]
|
67
|
|
- acc[name] = value
|
68
|
|
- return acc
|
69
|
|
- }, {}),
|
|
67
|
+ Promise.all(permissions.map(permission => this.check(permission))).then(
|
|
68
|
+ result =>
|
|
69
|
+ result.reduce((acc, value, index) => {
|
|
70
|
+ const name = permissions[index]
|
|
71
|
+ acc[name] = value
|
|
72
|
+ return acc
|
|
73
|
+ }, {}),
|
70
|
74
|
)
|
71
|
75
|
}
|
72
|
76
|
|
73
|
|
-export default new ReactNativePermissions()
|
|
77
|
+module.exports = new ReactNativePermissions()
|