Search code examples
iosgeolocationionic-frameworkcordova-plugins

iOS Simulator allow cordova geolocation, using ionic framework


I'm testing my cordova geolocation in my iOS simulator. When I called the function a message popped up asking if i would allow my app to use my current geolocation and I accidentally clicked "don't allow" now it just errors when i hit the button how do i change that to allow.

Might help:

 $scope.getCurrentLocation = function(){
    var posOptions = {timeout: 10000, enableHighAccuracy: false};
    $cordovaGeolocation
      .getCurrentPosition(posOptions)
      .then(function (position) {
        var lat  = position.coords.latitude
        var long = position.coords.longitude

        console.log(lat, long);
      }, function(err) {
        console.log(error);
      });
    }
  }

Solution

  • you need to go into the setting on the emulator and reset the permission on the application for geolocation