Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-11178

iOS: Implement iOS6 Core Location AutoPause API

    Details

    • Sprint:
      Release 3.0.0

      Description

      Problem

      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)

      Test case

      A test application compiled against iOS6 implementing Ti.Geolocation tracking will receive no updates when going into background. Our application did receive a location update every 4 to 5 minutes with horrible accuracy (1000s of meters)

      References

      WWDC 2012 video explaining the AutoPause API: https://developer.apple.com/videos/wwdc/2012/?include=303#303
      WWDC 2012 Slides explaining the AutoPause API: http://adcdownload.apple.com//wwdc_2012/wwdc_2012_session_pdfs/session_303__staying_on_track_with_location_services.pdf

      CLLocationManager Class Reference (pausesLocationUpdatesAutomatically and activityType properties): http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

      CLLocationManagerDelegate protocol reference (pause eventlisteners): http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/CLLocationManagerDelegate/CLLocationManagerDelegate.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                srahim Sabil Rahim
                Reporter:
                timanrebel Timan Rebel
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code