Titanium Community Questions & Answer Archive

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

Stop processing if locationservices==false

Is there a way for this? My app is pretty useless without it, so if they dont have it enabled, I have an alertDialog that tells them it needs to be enabled.

                var locationDialog = Titanium.UI.createAlertDialog({
                title: 'Error',
                message: 'Location Services needs to be enabled for this application',
                buttonNames: ['OK']


Can I have the button I generate in the alert dialog to open the Location Services in the settings dialog, and stop processing the rest of the app?

— asked October 26th 2010 by Josh Lewis
  • locationservicesenabled
  • processing
  • stop

1 Answer

  • Allegedly there is no approved way of launching the settings screen from an alert.

    The closest you can get is to edit your tiapp.xml and set the persistent-wifi key to true, clean the iPhone build folder by deleting the contents of the folder and rebuilding your app. Doing this will force a setting called UIRequiresPersistentWiFi in your applications Info.plist and it will make iOS complain if the app is in airplane mode and will give you a button that lets you change the settings.

    No this isn't necessarily a great or real fix, just some info about the one way to invoke settings.

    — answered October 26th 2010 by John McKnight
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.