Skip to content

Commit 0ecbb90

Browse files
authored
Merge pull request #163 from convoyinc/v1.0.1
Fixed request logic for OS versions prior to Android M (6.0 that is)
2 parents 11e376a + ef3b88d commit 0ecbb90

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.android.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class ReactNativePermissions {
7070

7171
return RNPermissions.request(androidPermission)
7272
.then(res => {
73+
// RNPermissions.request() to native module resolves to boolean
74+
// rather than string if running on OS version prior to Android M
75+
if (typeof res === 'boolean') return res ? 'authorized' : 'denied';
7376
return setDidAskOnce(permission)
7477
.then(() => RESULTS[res])
7578
});

0 commit comments

Comments
 (0)