Skip to content

Commit 921cc22

Browse files
author
Kanta Asada
committed
Fix rationale parameter to optional.
1 parent 72f63b8 commit 921cc22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.android.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ReactNativePermissions {
6161
})
6262
}
6363

64-
request = (permission, { rationale }) => {
64+
request = (permission, options) => {
6565
const androidPermission = permissionTypes[permission]
6666

6767
if (!androidPermission) {
@@ -72,6 +72,11 @@ class ReactNativePermissions {
7272
)
7373
}
7474

75+
let rationale = null
76+
if (options != null) {
77+
rationale = options.rationale
78+
}
79+
7580
return PermissionsAndroid.request(androidPermission, rationale).then(
7681
result => {
7782
// PermissionsAndroid.request() to native module resolves to boolean

0 commit comments

Comments
 (0)