title: Cannot get current position without GPS on react-native with navigator.geolocation
body: <p><strong>Brief summary after discussion and answers</strong>:</p>
  
  <p>using EXPO sdk you cannot get the device location without grant FINE_LOCATION in android. FINE_LOCATION is the only method to get location, so, you cannot get the hardware.network.location. That means: with android > 6 you cannot get the current location using WIFI/mobile networks, you must enable Location.</p>
  
  <p><strong>Expo github discussion:</strong> <a href="https://github.com/expo/expo/issues/1339" rel="noreferrer">https://github.com/expo/expo/issues/1339</a></p>
  
  <p><strong>The initial problem:</strong></p>
  
  <p>im working on a <strong>react-native</strong> application,  <strong>using expo and react-native-maps</strong>, and i need to get the latitude and longitud of the user current position. </p>
  
  <p>Im using <a href="https://developer.mozilla.org/es/docs/Web/API/Geolocation/getCurrentPosition" rel="noreferrer">navigator.geolocation API</a> for that </p>
  
  <p>with the GPS turned on i have no problems, but i need to get the current position without GPS, based on the network provider. </p>
  
  <p>The problem is that when the application runs <strong>with expo on androiod > 6</strong> i get this error: </p>
  
  <blockquote>
    <p>21:50:53: Finished building JavaScript bundle in 449ms 21:50:55:
    Location services are disabled
    - node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:80:57
    in 
    - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:347:19
    in __invokeCallback
    - ... 4 more stack frames from framework internals</p>
  </blockquote>
  
  <p>In IOs and android &lt;=5 it works great. </p>
  
  <p>Here is the code of the component:</p>
  
  <pre><code>class MyComponent extends Component {
  
      componentWillMount = () =&gt; {    
              this.getCurrentLocation();    
      }
      getCurrentLocation = () =&gt;
           navigator.geolocation.getCurrentPosition(
              (position) =&gt; {
                  let currentUserPosition = position.coords;
                  alert(JSON.stringify(currentUserPosition));
              },
              (error) =&gt; {
                  console.log(error);
              },
              {
                  enableHighAccuracy: false,
                  timeout: 20000,
                  maximumAge: 0,
                  distanceFilter: 10
              }
          );
  
  }
  </code></pre>
  
  <p>And this are my package.json depencendies:</p>
  
  <pre><code>"dependencies": {
      "expo": "23.0.4",
      "native-base": "^2.3.5",
      "react": "16.0.0",
      "react-native": "0.50.4",
      "react-native-extend-indicator": "^0.1.2",
      "react-native-maps": "^0.19.0",
      "react-native-maps-directions": "^1.3.0",
      "react-native-router-flux": "4.0.0-beta.21",
      "react-navigation": "1.0.0-beta.21",
      "react-navigation-redux-debouncer": "^0.0.2",
      "react-redux": "^5.0.6",
      "redux": "^3.7.2",
    }
  </code></pre>
  
  <p>I expect that navigator.geolocation get the location based on the network provider in that situation (without gps), the specification saids that.. </p>
  
  <p>i also tried with the Geolocation API of expo (tried this example: <a href="https://snack.expo.io/@schazers/expo-map-and-location-example" rel="noreferrer">https://snack.expo.io/@schazers/expo-map-and-location-example</a>) , and with the GPS turned OFF i cant get my location.. </p>
  
  <p>so.. is there a way to achieve what i want? i am missing something?</p>
  
  <p><strong>EDIT (EXPO CONTRIBUTOR ANSWER):</strong></p>
  
  <p>I have posted the same at expo github (<a href="https://github.com/expo/expo/issues/1339" rel="noreferrer">https://github.com/expo/expo/issues/1339</a>), according to them it is imposible to get the current position using navigator.geolocation without any level of Location enabled in a android device.. so .. the only thing that could happen is that android versions older than 5 has location enabled by default and you can turn on just the GPS, and the versions 6 and forward you must specify the location level .. </p>
  
  <p>any ideas?</p>
  
  <p><strong>EDIT2 (IMPORTANT !!):</strong></p>
  
  <p>I have confirmed this:</p>
  
  <p><a href="https://i.stack.imgur.com/8bcO5.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/8bcO5.jpg" alt="enter image description here"></a></p>
  
  <p>this is security settings of a Android 6 device, by default it uses GPS, i think that android 5 or lower doesnt, so thats the thing.. <strong>when i use the 2nd option it gets me the location !</strong></p>
  
  <p>the fact is that forcing a user to enable Location is like "hey, use your GPS!", and there are a lot of applications that gives you a aproximated position without turning on Location (like Uber for example), so the question is, <strong>is there a way that ONLY using wifi get the location with this api?</strong></p>