Titanium Community Questions & Answer Archive

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

Stopping GPS Service

Is there a way to stop the GPS services once you have captured the location data and removed the listener without having to close the app?

— asked December 3rd 2010 by Thomas Wheeler
  • geolocation
  • iphone

2 Answers

  • Accepted Answer

    looks like the appropriate way is to remove the listeners you have created and then the location services will shut down and cleanup after itself.

    look at the code where removeListener is called in the GeolocationModule

    — answered December 4th 2010 by Aaron Saunders
    1 Comment
    • Ya i saw this and attempted to use it before but ran into problems with the app crashing when removing the listener. I will create a test scenario and give it a shot thanks.

      — commented December 4th 2010 by Thomas Wheeler
  • You can use a isCalled boolean and check it on the first line of the function and then set it true the first time it runs through.

    — answered December 3rd 2010 by Sj Singh
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.