react-native-developer-options-android
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i react-native-developer-options-android

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

16.4 kB

Total Files

16

Last publish

Collaborators

  • adityaindiadev