How to use react-native-get-location - 5 common examples

To help you get started, we’ve selected a few react-native-get-location examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github douglasjunior / react-native-get-location / Sample / App.js View on Github external
_requestLocation = () => {
        this.setState({ loading: true, location: null });

        GetLocation.getCurrentPosition({
            enableHighAccuracy: true,
            timeout: 150000,
        })
            .then(location => {
                this.setState({
                    location,
                    loading: false,
                });
            })
            .catch(ex => {
                const { code, message } = ex;
                console.warn(code, message);
                if (code === 'CANCELLED') {
                    Alert.alert('Location cancelled by user or by another request');
                }
                if (code === 'UNAVAILABLE') {
github douglasjunior / react-native-get-location / Sample / App.js View on Github external
onPress={() => {
                            GetLocation.openAppSettings();
                        }}
                    />
github douglasjunior / react-native-get-location / Sample / App.js View on Github external
onPress={() => {
                            GetLocation.openCelularSettings();
                        }}
                    />
github douglasjunior / react-native-get-location / Sample / App.js View on Github external
onPress={() => {
                            GetLocation.openGpsSettings();
                        }}
                    />
github douglasjunior / react-native-get-location / Sample / App.js View on Github external
onPress={() => {
                            GetLocation.openWifiSettings();
                        }}
                    />

react-native-get-location

⚛ Simple to use React Native library to get device location for Android and iOS.

MIT
Latest version published 4 months ago

Package Health Score

71 / 100
Full package analysis