Steps to reproduce:
1. Use the code below in your app.js:
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title: 'Click Me'
});
btn.addEventListener('click', function(e) {
console.log('Ti.Geolocation.hasLocationPermissions() ' + Ti.Geolocation.hasLocationPermissions());
console.log('Ti.Geolocation.locationServicesEnabled ' + Ti.Geolocation.locationServicesEnabled);
alert('locationServicesEnabled = ' + Ti.Geolocation.locationServicesEnabled);
if (Ti.Geolocation.hasLocationPermissions()) {
getCurrentPosition();
} else {
Ti.Geolocation.requestLocationPermissions(null, getCurrentPosition);
}
});
function getCurrentPosition() {
Ti.Geolocation.getCurrentPosition(function(e) {
console.log('Ti.Geolocation.getCurrentPosition() ' + JSON.stringify(e));
});
}
win.add(btn);
win.open();
2. Make sure you do not have ti.playservices module in your app.
3. Build the app on Android device/emulator. (I saw the logs on Nexus 6P Android 8.0 & Android 4.4.4 emulator).
4. After app launch tap click me button.
5. Allow location permissions.
6. Check the logs.
Actual results:
1. These info logs are seen :
https://gist.github.com/lokeshchdhry/bc231d92727852c4a74f8f37e3465d53
Expected results:
1. The info logs should not be logged.
-master:- https://github.com/appcelerator/titanium_mobile/pull/9876
master: https://github.com/appcelerator/titanium_mobile/pull/9950
[~gmathews], Can you please provide a backport.
7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9951
FR Passed. PR's merged.
Verified in SDK Version 7.1.1.v20180322144031 and 7.2.0.v20180322112525. Test and other information can be found at: 7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9951 Master: https://github.com/appcelerator/titanium_mobile/pull/9950