title: HTML5 geolocation 'permission denied' error in mobile Safari
body: <p>I'm creating a mobile website which requests the users current position on button click using HTML5 geolocation. This works fine in mobile Chrome - the user is prompted to share their current location, and if they accept, program flow continues as expected. However, in mobile Safari, the user is never prompted to share their location and the browser defaults to the geolocation's 'PERMISSION_DENIED' error.</p>
  <p>It's acting as if the user opted not to share their location although they are never prompted...</p>
  <p>Geolocation code:</p>
  <pre><code>function geoLocate() {
  try{
      if(navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(getUserPosition, handleGeolocateErrors);
      } else {
          alert('your browser does not support geolocation');
      }
  } catch(evt) {
      alert(evt);
  }
  
  }
  </code></pre>
  <p>Error handling:</p>
  <pre><code>function handleGeolocateErrors(error) {
  switch(error.code) {
      case error.PERMISSION_DENIED: alert('User did not share location'); break;
      case error.POSITION_UNAVAILABLE: alert('Unable to get position'); break;
      case error.TIMEOUT: alert('Request timed out'); break;
      default: alert('An error occured'); break;
  }
  }
  </code></pre>