Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23389] Windows: Ti.Geolocation does not prompt location permission

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-05-17T15:26:56.000+0000
Affected Version/sRelease 5.3.0
Fix Version/sRelease 5.3.0
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2016-05-17T13:53:45.000+0000
Updated2016-05-17T23:28:14.000+0000

Description

[~htbryant] reported there's no prompt to ask for location permission on Windows 10 Mobile.
var win = Ti.UI.createWindow({ backgroundColor: 'green' });
var label = Ti.UI.createLabel({
    color: "blue",
    text: "Get Current Position"
});

win.add(label);

label.addEventListener('click', function () {
    if (Ti.Geolocation.locationServicesAuthorization == Ti.Geolocation.AUTHORIZATION_DENIED) {
        Ti.API.info('Location request has been denied');
        return;
    } else {
        Ti.API.info('Location request has been granted');
    }
    Ti.Geolocation.getCurrentPosition(function (e) {
        Ti.API.info(JSON.stringify(e.coords));
    });
});

Ti.Geolocation.addEventListener("location", function (e) {
    Ti.API.info(JSON.stringify(e.coords));
});

win.addEventListener('open', function () {
    Ti.API.info('Ti.Geolocation.locationServicesEnabled: ' + Ti.Geolocation.locationServicesEnabled);
});

win.open();

Comments

  1. Kota Iguchi 2016-05-17

    https://github.com/appcelerator/titanium_mobile_windows/pull/700
  2. Harry Bryant 2016-05-17

    Verified as fixed. Using the demo code provided location permissions is requested. Tested on: Windows 10 Pro Windows Phone 10.0 (Microsoft Lumia 640 LTE) Appc Studio: 4.6.0.201605030516 Ti SDK: 5.3.0.v20160517124218 Appc NPM: 4.2.5-5 Appc Core: 5.3.0-44 Node: v4.4.4 *Closing Ticket.*

JSON Source