Titanium Community Questions & Answer Archive

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

OS 4.0 and geolocation

Hi guys,
I'm trying to run my app on OS 4.0.
I downloaded and compiled the 1.3.3 sdk.
Geolocation doesn't work both on my app and kitchensink.
It seems that events don't fire. I also added

Ti.Geolocation.purpose = "GPS demo";

But with no result.
Thanks for your help!

[UPDATE] kitchensink geolocation doesn't work on simulator but it works on the device. Trying to fix my app.

— asked July 2nd 2010 by Flavio Ferrandi
  • 1.3.2
  • 4.0
  • geolocation

3 Answers

  • Generally the simulators/emulators don't provide for geolocation - although some of them do allow mock locations via their control app to be set (adb on Android & gdb on Apple).

    You should check Ti.Geolocation.locationServicesEnabled to see if location services are available - technically this should do the heavy lifting for you - but I'm not sure it works in all scenarios.

    — answered July 2nd 2010 by David Ashwood
  • I have the same issue, on one machine Geolocation works (kitchensink + emulator), on the other it doesn't. LocationServices are Enabled. I've tried looking for settings to allow location services, but could not find any in the emulator, emulator prefs, or titanium developer.

    — answered March 24th 2011 by thomas heijmans
  • If you are using iOS 4.0+ as well as OSX 10.6+ with location services enable (System Preferences/Security and Privacy/Privacy/ Enable Location Service check box) the simulator should return YOUR ACTUAL LOCATION INFO to the Ti.Geolocation.getCurrentPosition function. With this in mind, userLocation = true on a mapview will still display your current location at Apple Headquarters in Cupertino CA.

    — answered July 22nd 2011 by Taylor Jones
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.