Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19021] Windows: Geolocation module always reporting location services disabled

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-06-25T12:53:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsWindows
Labelsn/a
ReporterJörgen Buder
AssigneeKota Iguchi
Created2015-06-15T15:10:59.000+0000
Updated2017-03-16T21:51:59.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. Kota Iguchi 2015-06-25

    https://github.com/appcelerator/titanium_mobile_windows/pull/323
  2. Jörgen Buder 2015-06-25

    Thanks... :)
  3. Lee Morris 2017-03-16

    Closing ticket as the issue has been fixed.

JSON Source