0.1.5 • Published 6 months ago

expo-androidwebviewdetector v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

expo-androidwebviewdetector

android webView detector for expo

Installation in managed Expo projects

npm i expo-androidwebviewdetector

it must be used with custom dev client because of native functions

API documentation

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>
  );
}