title: Ti.Geolocation callbacks only works when running KitchenSink
body: <p>I have a problem with Ti.Geolocation that drives me crazy. Only using IOS platform so far. The goal is to get GPS callbacks with highest possible accuracy when I move around with the phone.</p>
  
  <p>The problem is that I have copied most of the code from geolocation.js in KitchenSink, with the relevant part shown below. It looks OK to me, however the behaviour I get is very strange.</p>
  
  <p>I just don't get regular GPS callbacks when I walk around! The compass works fine however and sends me callbacks all the time. I have also tried without subscribing to 'heading' events, but no change in GPS behaviour.</p>
  
  <p>There is only one event that can trigger a GPS-callback with correct data, and that is running KitchenSink! Switching to KitchenSink and back also gives me a callback with accuracy between 5 and 10. If I don't do that, my accuracy can be as high as 1500-2500 (if I get a callback at all, that is).</p>
  
  <p>KitchenSink seems to work fine, but I fail to see what that app does that I do not?!?</p>
  
  <p>I have turned off Wifi in the phone so it wont disturb. This problem is very frustrating and I have spent three days on it now, can someone please help? I have tried compiling against different SDK's too (normally 2.1.1GA but also down to 1.8.2). No change.</p>
  
  <pre><code>if (locationServicesAvailable()) {
      // APPLICATION LOGIC
      ui.init();
  
      Ti.Geolocation.purpose = "Get Lat/Long of your current position";
      Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
  
      Ti.Geolocation.distanceFilter = 10;
      Ti.Geolocation.frequency = 0; /* as fast as possible */
      Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS;
  
      if (Ti.Geolocation.hasCompass) {
          //  TURN OFF ANNOYING COMPASS INTERFERENCE MESSAGE
          Ti.Geolocation.showCalibration = false;
          // SET THE HEADING FILTER (THIS IS IN DEGREES OF ANGLE CHANGE)
          // EVENT WON'T FIRE UNLESS ANGLE CHANGE EXCEEDS THIS VALUE
          Ti.Geolocation.headingFilter = 45;
          /*
          Ti.Geolocation.getCurrentHeading(handleCompass);
          Ti.Geolocation.addEventListener('heading', handleCompass);
          */
      }
  
      Ti.Geolocation.getCurrentPosition(handlePosition);
      Ti.Geolocation.addEventListener('location', handlePosition);
  
      ui.refresh.addEventListener('click', function(e) {
          Ti.Geolocation.getCurrentPosition(handlePosition);  
      });
  }
  </code></pre>