Skip to content

Commit 86807be

Browse files
committed
Avoid relying on shouldShowRequestPermissionRationale on Android
1 parent 5c92361 commit 86807be

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/index.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import {
1414

1515
import {ANDROID, IOS, PERMISSIONS, RESULTS} from './constants';
1616

17-
const NativePermissionsAndroid = NativeModules.PermissionsAndroid;
18-
1917
const RNPermissions: {
2018
// Android + iOS
2119
checkNotifications: () => Promise<NotificationsResponse>;
@@ -93,15 +91,9 @@ export async function check(permission: Permission): Promise<PermissionStatus> {
9391

9492
const nonRequestables = await RNPermissions.getNonRequestables();
9593

96-
if (!nonRequestables.includes(permission)) {
97-
return RESULTS.DENIED;
98-
}
99-
100-
return (await NativePermissionsAndroid.shouldShowRequestPermissionRationale(
101-
permission,
102-
))
103-
? RESULTS.DENIED
104-
: RESULTS.BLOCKED;
94+
return nonRequestables.includes(permission)
95+
? RESULTS.BLOCKED
96+
: RESULTS.DENIED;
10597
}
10698

10799
export async function request(

0 commit comments

Comments
 (0)