Starting with iOS 8, to use location services, add either the the
NSLocationWhenInUseUsageDescription or or
NSLocationAlwaysUsageDescription key key to the iOS plist section of the project's
tiapp.xml file. To localize the message, see Internationalization: Localize Property List Keys.
<ti:app> <ios> <plist> <dict> <key>NSLocationAlwaysUsageDescription</key> <string> Specify the reason for accessing the user's location information. This appears in the alert dialog when asking the user for permission to access their location. </string> </dict> </plist> </ios> </ti:app>
On iOS you can find out why the permission has been refused. A very thourough example for requesting permissions was created in the 5.1.0 sample app, which is available on GitHub https://github.com/appcelerator-developer-relations/appc-sample-ti510/blob/master/app/controllers/permissions.js
Detect if location services are available
To determine whether or not location services will be available to you on the current mobile device, you simply need to check the boolean property
Ti.Geolocation.locationServicesEnabled. Keep in mind, though, that on Android 2.2 and above, a low-precision "passive" location provider is enabled at all times, even when the user disables both the GPS and Network location providers. Therefore, this method always returns
true on such devices. With this in mind, the base skeleton of a locations based app might look something like this.