I am having following problem with the location service with IOS on the simulator:
using phonegap 2.2.0 with xcode 4.5.2,
Cordova.plist EnableLocation = YES
navigator.geolocation.getCurrentPosition(myPositionSuccess, myPositionError, {maximumAge: 300000, timeout:10000, enableHighAccuracy : true});
myPositionSuccess is never called, with following error at navigator.geolocation
locationManager::didFailWithError (null)
I just tried it on the simulator. Any Idea?
Exit the simulator & run your app again. Worked for me.
I was having the same error with XCode Version 4.3.2 & cordova/phonegap 2.1.0
The simulator was unable to get my location even when I ran Google Maps in Safari. That led me to the conclusion that it was more than just my project that was at fault.
I am still unable to figure out exactly why restarting the simulator worked, but there is one possible reason.
I usually shut down my Mac without quitting most of my running apps & the "Reopen windows when logging back in" option checked. The simulator, however, is one of the apps i definitely quit. But the last time I shut down, I did not quit it. So, like I said, possible reason.
Hope this helps you.
Another thing may be to check the location setting in your simulator, I believe the default setting is none which means the geolocation will not find anything. If you are running your simulator, go to Debug > Location > City Run or some other choice and then try to use the geolocation function again it should work fine.
I know this is a bit old but I was looking for an answer on this when I remembered the location setting so I figured I would post here for future reference in case anyone needs it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With