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.
Closing, duplicate of TIMOB-25797