Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-1837

iOS: geolocation is active when there are no listeners attached

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Component/s: Titanium SDK & CLI
    • Labels:
    • Environment:

      iPhone 4, iOS 6.1.3, SDK 3.1.1.v20130516183044 and SDK 3.1.0.GA

      Description

      Problem description
      Geolocation icon ("arrow") is visible in iPhone status bar, but there are no listeners attached to Ti.Geolocation. Location services seems to be active and consuming battery. The icon disappears only after uninstalling the app. Killing it is useless.

      Also, in console log there is a line:

      May 24 21:56:22 Ilya-Shapovalovs-iPhone locationd[46] <Notice>: Location icon should now be in state 'Active'
      

      And there should be line with "Location icon should now be in state 'Inactive'", but there isn't.

      This problem was encountered by end users of the app at first (so, it covers different versions of iOS and different iPhone models).

      Steps to reproduce
      1. create new project - titanium - single window application
      2. Insert following code in app.js or ApplicationWindow.js:

      var win = Ti.UI.createWindow({
      	backgroundColor : "#FFF"
      });
       
      //Ti.Geolocation.trackSignificantLocationChange = true; - tried this one also. In log there is a couple of "cb", a couple of "timeout" but the rest of the log is same (it's provided below)
       
      Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_LOW;
      var cb = function() {
      	console.log('cb');
       
      	if (false) { // immediate removal of listener does not solve my issue, either
      		Ti.Geolocation.removeEventListener('location', cb);
      	} else {
      		setTimeout(function() {
      			console.log('timeout');
      			Ti.Geolocation.removeEventListener('location', cb);
      		}, 3000);
      	}
      }
      Ti.Geolocation.addEventListener('location', cb);
       
      win.open();
      

      Log

      May 24 22:03:26 Ilya-Shapovalovs-iPhone testgeo[1541] <Warning>: [DEBUG] Application booted in 1071.326017 ms
      May 24 22:03:27 Ilya-Shapovalovs-iPhone testgeo[1541] <Warning>: [INFO] cb
      May 24 22:03:28 Ilya-Shapovalovs-iPhone locationd[46] <Notice>: Location icon should now be in state 'Active'
      May 24 22:03:28 Ilya-Shapovalovs-iPhone awdd[1548] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
      May 24 22:03:28 Ilya-Shapovalovs-iPhone awdd[1548] <Error>: CoreLocation: CLClient is deprecated. Will be obsolete soon.
      May 24 22:03:30 Ilya-Shapovalovs-iPhone locationd[46] <Notice>: received EBUSY, try kScanTypeChannel, channel, 6, rssi -60, delayed 0.000s
      May 24 22:03:30 Ilya-Shapovalovs-iPhone testgeo[1541] <Warning>: [INFO] timeout
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mpmiranda Mauro Parra-Miranda
                Reporter:
                shepik Ilya Shapovalov
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code