title: Permission denied - geolocation in React Native
body: <p>I've been playing around with React Native, getting custom locations to work and setting the "NSLocationWhenInUseUsageDescription" key. The error, when running on the ios simulator, is this:</p>
  
  <pre><code>{
   "code": 2,
   "message": "Unable to retrieve location.",
   "PERMISSION_DENIED": 1,
   "POSITION_UNAVAILABLE": 2,
   "TIMEOUT": 3 
  }
  </code></pre>
  
  <p>This is what I have, pretty much straight from the Geolocation example page <a href="https://facebook.github.io/react-native/docs/geolocation.html" rel="noreferrer">https://facebook.github.io/react-native/docs/geolocation.html</a></p>
  
  <pre><code>/* eslint no-console: 0 */
  'use strict';
  
  var React = require('react');
  var ReactNative = require('react-native');
  var {
    StyleSheet,
    Text,
    View,
  } = ReactNative;
  
  export default class GeolocationExample extends React.Component {
    state = {
      initialPosition: 'unknown'
    };
  
    componentDidMount() {
      navigator.geolocation.getCurrentPosition(
        (position) =&gt; {
          var initialPosition = JSON.stringify(position);
          this.setState({initialPosition});
        },
        (error) =&gt; alert(JSON.stringify(error)),
        {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000}
      );
    }
  
    render() {
      return (
        &lt;View&gt;
          &lt;Text&gt;
            &lt;Text style={styles.title}&gt;Initial position: &lt;/Text&gt;
            {this.state.initialPosition}
          &lt;/Text&gt;
        &lt;/View&gt;
      );
    }
  }
  
  var styles = StyleSheet.create({
    title: {
      fontWeight: '500',
    },
  });
  </code></pre>
  
  <p>Any help would be appreciated! </p>