android webView detector for expo
npm i expo-androidwebviewdetector
it must be used with custom dev client because of native functions
example:
import { StatusBar } from 'expo-status-bar';
import { Button, StyleSheet, Text, View } from 'react-native';
import { deviceCanWebView, webViewEnabled, goToSettings } from 'expo-androidwebviewdetector';
export default function App() {
return (
<View style={{ flex:1, alignItems: 'center', justifyContent: 'center'}}>
<Text>is this device android webview setting capable :
{JSON.stringify(deviceCanWebView())}</Text>
<Text>is this device android webview setting enabled :
{JSON.stringify(webViewEnabled())}</Text>
{
!webViewEnabled() &&
<Button title="Go to settings" onPress={() => goToSettings()} />
}
</View>
);
}