File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -129,9 +129,11 @@ if (RNPermissions == null) {
129129If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-permissions` ) ;
130130}
131131
132- const platformPermissions = Object . values (
133- Platform . OS === 'ios' ? IOS : ANDROID ,
134- ) ;
132+ const platformPermissions = Platform . select < Permission [ ] > ( {
133+ ios : Object . values ( IOS ) ,
134+ android : Object . values ( ANDROID ) ,
135+ default : [ ] ,
136+ } ) ;
135137
136138function isPlatformPermission ( permission : Permission ) : boolean {
137139 if ( platformPermissions . includes ( permission ) ) {
@@ -158,7 +160,7 @@ export async function check(permission: Permission): Promise<PermissionStatus> {
158160 return RESULTS . UNAVAILABLE ;
159161 }
160162
161- if ( Platform . OS !== 'android ') {
163+ if ( Platform . OS === 'ios ') {
162164 return RNPermissions . check ( permission ) ;
163165 }
164166
@@ -194,7 +196,7 @@ export async function request(
194196 return RESULTS . UNAVAILABLE ;
195197 }
196198
197- if ( Platform . OS !== 'android ') {
199+ if ( Platform . OS === 'ios ') {
198200 return RNPermissions . request ( permission ) ;
199201 }
200202
You can’t perform that action at this time.
0 commit comments