1.1.0 • Published 9 months ago

react-native-developer-options-android v1.1.0

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

react-native-developer-options-android

Check if the Android device has the developer options enabled.

Developed By

Aditya Gupta    LinkedIn   GitHub

Installation

npm install react-native-developer-options-android

Usage

import * as React from 'react';

import { StyleSheet, View, Text } from 'react-native';
import { isDeveloperOptionsEnabled } from 'react-native-developer-options-android';

export default function App() {
  const [isDeveloperOptionsOn, setIsDeveloperOptionsOn] = React.useState<boolean | undefined>();

  React.useEffect(() => {
    isDeveloperOptionsEnabled(handleResult)
  }, []);

  const handleResult = (isEnabled: boolean) => {
    console.log('Developer Options Enabled', isEnabled);
    setIsDeveloperOptionsOn(isEnabled)
  };

  return (
    <View style={styles.container}>
      <Text>isDeveloperOptionsEnabled: {String(isDeveloperOptionsOn)}</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  box: {
    width: 60,
    height: 60,
    marginVertical: 20,
  },
});

License

MIT


Made with create-react-native-library