I downloaded the last xcode ( new hdd on my mac ) and now the geolocation does not work anymore in simulator.
This is the error message I get
"Error Domain=kCLErrorDomain Code=0 \"The operation couldn’t be completed. (kCLErrorDomain error 0.)\""
iphone sdk 4.1
Titanium 1.4.2( a build that was fully working on the previous install)
Installed ios SDK 4.0.2 and it happens the same.
I'm on snow leopard.
It seems that even mobile safari cannot detect the location.
I had the same problems.
I really don't know what exactly caused the problem but as soon as I was connected to my ISP at home the geolocation didn't work.
I was able to confirm it with three iPhones. The problems are resolved now but I am sure this had something to do with my ISP.
Did you add this:
Ti.Geolocation.purpose = "GPS demo";
This is a required param now. :-)
The issue is that because laptops and PCs do not (normally) have GPS, it uses your ISP and local wifi networks to try to get your location… some firewalls can cause an issue with this.
Sadly there is no way around this issue. It is not an issue with the iPhone SDK or Titanium, but rather your computers network.
P.S. even when it DOES work, 99% of the time, it has you at some random location up to 25 miles from where you actually are. But run the code on your device and it will use the REAL GPS.
Yes, it's clear that the location is based on the wifi spots, ip, etc.
In fact the issue seems to be on apple's side.
They changed something so my tiny little town is not anymore on their map :)
Mine never uses my local wifi/isp on the simulator, it always defaults to Apple headquarters.