How to use the react-native-geolocation-service.watchPosition function in react-native-geolocation-service

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

github Agontuk / react-native-geolocation-service / example / App.js View on Github external
this.setState({ updatesEnabled: true }, () => {
      this.watchId = Geolocation.watchPosition(
        (position) => {
          this.setState({ location: position });
          console.log(position);
        },
        (error) => {
          this.setState({ location: error });
          console.log(error);
        },
        { enableHighAccuracy: true, distanceFilter: 0, interval: 5000, fastestInterval: 2000 }
      );
    });
  }

react-native-geolocation-service

React native geolocation service for iOS and android

MIT
Latest version published 2 days ago

Package Health Score

80 / 100
Full package analysis

Similar packages