|
@@ -61,7 +61,7 @@ class ReactNativePermissions {
|
61
|
61
|
})
|
62
|
62
|
}
|
63
|
63
|
|
64
|
|
- request = (permission, { rationale }) => {
|
|
64
|
+ request = (permission, { rationale }) => {
|
65
|
65
|
const androidPermission = permissionTypes[permission]
|
66
|
66
|
|
67
|
67
|
if (!androidPermission) {
|
|
@@ -72,15 +72,17 @@ class ReactNativePermissions {
|
72
|
72
|
)
|
73
|
73
|
}
|
74
|
74
|
|
75
|
|
- return PermissionsAndroid.request(androidPermission, rationale).then(result => {
|
76
|
|
- // PermissionsAndroid.request() to native module resolves to boolean
|
77
|
|
- // rather than string if running on OS version prior to Android M
|
78
|
|
- if (typeof result === 'boolean') {
|
79
|
|
- return result ? 'authorized' : 'denied'
|
80
|
|
- }
|
|
75
|
+ return PermissionsAndroid.request(androidPermission, rationale).then(
|
|
76
|
+ result => {
|
|
77
|
+ // PermissionsAndroid.request() to native module resolves to boolean
|
|
78
|
+ // rather than string if running on OS version prior to Android M
|
|
79
|
+ if (typeof result === 'boolean') {
|
|
80
|
+ return result ? 'authorized' : 'denied'
|
|
81
|
+ }
|
81
|
82
|
|
82
|
|
- return setDidAskOnce(permission).then(() => RESULTS[result])
|
83
|
|
- })
|
|
83
|
+ return setDidAskOnce(permission).then(() => RESULTS[result])
|
|
84
|
+ },
|
|
85
|
+ )
|
84
|
86
|
}
|
85
|
87
|
|
86
|
88
|
checkMultiple = permissions =>
|