Use Linking.openSettings() so it works on Android (#865)

zio/stable
Logan Rosen 2023-06-08 23:47:24 -04:00 committed by GitHub
parent cae615769c
commit 9ac8c44a6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -4,10 +4,6 @@ import {Linking} from 'react-native'
import {isWeb} from 'platform/detection' import {isWeb} from 'platform/detection'
import {Alert} from 'view/com/util/Alert' import {Alert} from 'view/com/util/Alert'
const openSettings = () => {
Linking.openURL('app-settings:')
}
const openPermissionAlert = (perm: string) => { const openPermissionAlert = (perm: string) => {
Alert.alert( Alert.alert(
'Permission needed', 'Permission needed',
@ -17,7 +13,7 @@ const openPermissionAlert = (perm: string) => {
text: 'Cancel', text: 'Cancel',
style: 'cancel', style: 'cancel',
}, },
{text: 'Open Settings', onPress: () => openSettings()}, {text: 'Open Settings', onPress: () => Linking.openSettings()},
], ],
) )
} }