Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25798] Android: Unnecessary info logs in console when trying to use geolocation methods with no Ti.playservices

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionDuplicate
Resolution Date2018-02-22T21:58:39.000+0000
Affected Version/sRelease 7.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterLokesh Choudhary
AssigneeGary Mathews
Created2018-02-22T21:55:54.000+0000
Updated2018-02-22T21:58:39.000+0000

Description

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.

Comments

  1. Gary Mathews 2018-02-22

    Closing, duplicate of TIMOB-25797

JSON Source