[TIMOB-23389] Windows: Ti.Geolocation does not prompt location permission
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-05-17T15:26:56.000+0000 |
Affected Version/s | Release 5.3.0 |
Fix Version/s | Release 5.3.0 |
Components | Windows |
Labels | n/a |
Reporter | Kota Iguchi |
Assignee | Kota Iguchi |
Created | 2016-05-17T13:53:45.000+0000 |
Updated | 2016-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();
https://github.com/appcelerator/titanium_mobile_windows/pull/700
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.*