title: TypeError: undefined is not an object( evaluating 'navigator.geolocation.getCurrentPosition') in react-native-google-places-autocomplete
body: <p>I am trying to use <strong>react-native-google-places-autocomplete</strong> for google places and at the sametime I want user <strong>current position</strong> also. </p>
  
  <p>But im getting an error called as </p>
  
  <p><strong><em>TypeError: undefined is not an object( evaluating 'navigator.geolocation.getCurrentPosition')</em></strong></p>
  
  <p>i have gone through net searching for solutions everyone saying <strong>navigator.geolocation.getCurrentPosition</strong> works fine.</p>
  
  <p>but dont know why it is not working for me..</p>
  
  <p>Here is my code </p>
  
  <pre><code>componentDidMount() {
  navigator.geolocation.getCurrentPosition(
    position =&gt; {
      const initialPosition = JSON.stringify(position);
      let region = {
          latitude: position.coords.latitude,
          longitude: position.coords.longitude,
          latitudeDelta: 0.0922,
          longitudeDelta: 0.0421,
          }
      this.setState({initialPosition:region});
      console.log("lat "+position.coords.latitude+" longi "+position.coords.longitude)
      console.log("initialPosition")
      console.log(this.state.initialPosition)
    },
     error =&gt; console.log("Error "+ JSON.stringify(error)),
    {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000},
  );
  this.watchID = Geolocation.watchPosition(position =&gt; {
    const lastPosition = JSON.stringify(position);
    this.setState({lastPosition});
  });
  </code></pre>
  
  <p>}</p>