@adityaindiadev/react-native-developer-options-android
v1.1.2
Published
Check if the Android device has the developer options enabled.
Downloads
7
Maintainers
Readme
@adityaindiadev/react-native-developer-options-android
Check if the Android device has the developer options enabled.
Installation
npm install @adityaindiadev/react-native-developer-options-android
Usage
import * as React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { isDeveloperOptionsEnabled } from '@adityaindiadev/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