Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

geolocation with ios sdk 4.1 in simulator

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)

thanks

update:
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.

— asked October 16th 2010 by Dan Tamas
  • 4.1
  • geolocation
  • ios
  • iphone
  • sdk
0 Comments

4 Answers

  • 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. :-)

    — answered December 8th 2010 by Dominik Hahn
    permalink
    0 Comments
  • 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.

    — answered December 8th 2010 by Matt Apperson
    permalink
    0 Comments
  • 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 :)

    — answered December 8th 2010 by Dan Tamas
    permalink
    0 Comments
  • Mine never uses my local wifi/isp on the simulator, it always defaults to Apple headquarters.

    — answered December 8th 2010 by Josh Lewis
    permalink
    2 Comments
    • your location is, but not your gps, correct?

      — commented December 8th 2010 by Matt Apperson
    • My GPS never worked in the simulator. Even using the default maps, it goes to Apple's HQ

      — commented December 8th 2010 by Josh Lewis
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.