Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15088] Geolocation Accuracy sometimes resets from ACCURACY_BEST to ACCURACY_THREE_KILOMETERS

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.2
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterGordon Illan
AssigneeUnknown
Created2013-09-07T22:05:25.000+0000
Updated2018-02-28T20:03:18.000+0000

Description

Given that Ti.Geolocation.ACCURACY_BEST is defined as -1, the following code starting at line 275 in GeolocationModule.m, sometimes changes ACCURACY_BEST to ACCURACY_THREE_KILOMETERS.
-(CLLocationManager*)locationManager
{
	[lock lock];
	if (locationManager==nil)
	{
		RELEASE_TO_NIL(tempManager);
		locationManager = [[CLLocationManager alloc] init];
		locationManager.delegate = self;
		if (!trackSignificantLocationChange) {
            if (accuracy!= ACCURACY_BEST) // -1
            {
                locationManager.desiredAccuracy = accuracy;
            }
            else
            {
                locationManager.desiredAccuracy = ACCURACY_THREE_KILOMETERS;  //kCLLocationAccuracyThreeKilometers
            }
            locationManager.distanceFilter = distance;
        }
...
If you set the accuracy to ACCURACY_BEST before adding the event listener, then it's changed to ACCURACY_THREE_KILOMETERS. This issue was brought up by Ondrej Urik in a comment @ https://developer.appcelerator.com/question/116986

Comments

  1. Shawn Lipscomb 2017-05-05

    Why is this a low priority? It's been there for 3 major versions and looks like a simple fix.

JSON Source