Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19022] Windows: Geolocation never returning data for getCurentPosition

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-06-15T19:02:45.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsWindows
Labelsn/a
ReporterJörgen Buder
AssigneeChristopher Williams
Created2015-06-15T15:43:10.000+0000
Updated2017-03-16T21:53:08.000+0000

Description

This looks to be a mismatch in our implementation with the way the property is defined. We ask the current position status, but that value isn't "good" unless there's an active tracking session. The property is meant to convey if the app itself is set up to do location services, so it's more a check if they've set the DeviceCapability in their package/appx.manifest. I'm not sure if we can query capabilities at runtime or not. We might be able to do a simple call to the geolocator and catch exceptions to know if this property should be true or false.
Ti.API.info('GPS Enabled : ' + Ti.Geolocation.locationServicesEnabled);
//if (Ti.Geolocation.locationServicesEnabled) {
    Ti.API.info('Setting accuracy...');
    Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH;
    Ti.API.info('Asking for current position...');
    Ti.Geolocation.getCurrentPosition(function(e) {
            Ti.API.info('Got current position!');
            Ti.API.info('GPS Data : ' + JSON.stringify(e));
        });
//}

Comments

  1. Christopher Williams 2015-06-15

    https://github.com/appcelerator/titanium_mobile_windows/pull/284
  2. Lee Morris 2017-03-16

    Closing ticket as the issue has been fixed.

JSON Source