title: ionic ngCordova geolocation ask for permission
body: <p>I am using ionic framework to develop an android app. In my app I need to access the current geolocation of the user, I am using ngCordova for this.
  Here is my code.</p>
  
  <pre><code>var lat, long;
  var posOptions = {timeout: 10000, enableHighAccuracy: false};
  
  function getLocation() {
    $ionicLoading.show();
    $cordovaGeolocation
      .getCurrentPosition(posOptions)
      .then(function (position) {
        console.log('pos: ', position);
        lat = position.coords.latitude;
        long = position.coords.longitude;
      }, function (err) {
        console.log('err here: ',err)
        // error
      });
  }
  
  getLocation();
  </code></pre>
  
  <p>I am getting the data and by adding this line</p>
  
  <pre><code>&lt;plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/&gt;
  </code></pre>
  
  <p>I am asking user's permission to access geolocation. 
  But the problem is that, if the user has disabled the location initially and opens the app then after giving permission to access location I want to execute getLocation function again.</p>
  
  <p>So how would I know if user has denied or allowed the access ?</p>