Ios geolocation keep getting time out

hi, am trying to use the ngcordova geolocation plugin ( watchPosition ) in my ionic ios app. but am keep getting Time Our error ( code 3 ) , the same code works fine on android, i cant see my application in the iphone setting and even i was able to see the application in th esetting before but the privacy option was disabled for the location service for this application, any idea why that ? the code i use is

   var onSuccess = function (position) {
       console.log("get location OK");
   };

   function onError(error) {
       console.log("get location error " + JSON.stringify(error));
   }

   navigator.geolocation.getCurrentPosition(onSuccess, onError);

   var myoption = {
       frequency: 3 * 60 * 1000,
       maximumAge: 0,
       timeout: 1 * 60 * 1000,
       enableHighAccuracy: false
   };

   var mywatch = navigator.geolocation.watchPosition(function (position) {
       var pos;
       pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
       console.log(pos);

       navigator.geolocation.clearWatch(mywatch);
   }, function (err) {
       console.log(JSON.stringify(err));
    
       navigator.geolocation.clearWatch(mywatch);
     
   }, myoption); 

the ios version is 8.0.2, am running the mac os on vmware , the device is connected to and i run using the Xcode run, the application run normaly, but i cant get the location.

update: i tried creating new ionic app for the ios using the maps starter

ionic start maptest maps

and when i run this new app, also the same … geolocation not work !!

any help ??

same question?

looking for any working sample , yes

what is in the console.log?

have you tired deleting the app from the device and re-installing it? When you re-install, you should be prompted for permission

am running the app from the Xcode to the device, never asked me for permission

i get code 3 time out error, and in the device i never get the gps status little icon on top status

and you deleted and reinstalled? verified that the information is in the plist ?

yes , also same error

Where i suppose to set the permission ??

Working example can be found here: Gajotres - Best Technology Product Reviews, News, Tips, and Comparison

I’ve tested everything on real devices.

@firaskudsy, have you made this work? I am having the same problem here… I’ve also tried the Gajotres code (check my GitHub), but nothing works so far. Thanks.

If you’re still having trouble on iOS, try this. Finally, I got this working.

Sir i have tried tell m 1 thing u have called both geolocation function but very 1st time both function are fire for me but after logout then login it work plz tell m sir what the reason sir why function not fire…