No Location Updates When App is Closed
  • All,

    App Name: BairFinder
    Platform: iOS
    Geoloqi Titanium Module: Tested both 1.1 and 1.2
    Devices: iPhone 4, iPhone 4S, iOS 6.12

    This week I get no location updates when the application is closed. I have tried setting my profile to both REALTIME (which worked last week) and ADAPTIVE. In each case now I see in my logs that the reported profile (using getProfile) is correct. When I check the status using getStatus, I see NOTTRACKING.

    My geoloqi.init() code is in a gist at the link below.

    Any suggestions?

  • 1 Comment sorted by
  • Looks like I am waiting for the next Appcelerator Titanium release...
    For anyone having this problem using Appcelerator Titanium, I found this on their site:

    "In iOS 6 Apple has made breaking changes to Core Location by implementing the AutoPause API. The AutoPause API pauses the location updates when an application goes into the background and applies to a couple of criteria (i.e. user not moving, no location fix, user discontinues activity). To accurately handle pause events Apple requests to help better predicting whether or not to pause location updates setting an activity type (i.e. navigation, fitness, other).

    The AutoPause API is enabled by default when an application is compiled against iOS 6.

    The problem is that at this moment we, Appcelerator Mobile developers, are not able to configure the AutoPause API and updates are always paused when going into the background, even when UIBackgroundModes is set to location and the application is allowed to keep running in the background for longer then 10 minutes. This breaks the working of any tracking or navigation app and renders it useless.

    The easy fix is to disable the AutoPause API for now by always setting 'pausesLocationUpdatesAutomatically' to NO. Location updates will be send even when the app goes in the background, like it used to work in < iOS 6. Hopefully this could be implemented in the 2.1.3 GA release, so we can resubmit our app to the App Store.

    The best case scenario is to implement the AutoPause API by adding pausesLocationUpdatesAutomatically and activityType properties (CLLocationManager.h), the CLActivityType constants (CLLocationManager.h) and the pause event listeners (CLLocationManagerDelegate.h) to Ti.Geolocation(.iPhone)"

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion