Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

NSLocationWhenInUseUsageDescription - Geolocation is not activated.

$
0
0

I have a problem. When I indicate the key NSLocationAlwaysUsageDescription in info.plist (or tiapp.xml), everything works fine.

But how do I make geolocation work in such mode that it's only activated in foreground? I was trying to use the key NSLocationWhenInUseUsageDescription, but although the authorization message is correct, the "location" event is not firing!

When I replace the NSLocationWhenInUseUsageDescription by NSLocationAlwaysUsageDescription, everything works as expected.

The code is trivial:

Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS; Ti.Geolocation.frequency = 10; Ti.Geolocation.distanceFilter = 5; Ti.Geolocation.trackSignificantLocationChange = true; Ti.Geolocation.accuracy = 10; var func = function(e) { alert("geolocation"); } Ti.Geolocation.addEventListener("location",func);


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>