Details

      Description

      My problem is the following: When I try to track GPS location in the background it often forgets or removes the event listener and stops retrieving location updates.

      I’ve put an Interval in my background services file to try and keep my service alive, I’ve set a frequency check, when the location hasn’t been called for more than 30 seconds, it removes and then adds the location event listener again. All of this does not make the application stay alive.

      I’ve added the following settings in tiapp.xml, these are also shown in the capabilities tab in Xcode:

      <key>UIBackgroundModes</key>
      <array>
              <string>location</string>
              <string>remote-notification</string>
              <string>fetch</string>
      </array>
      <key>UIRequiredDeviceCapabilities</key>
      <array>
              <string>gps</string>
              <string>location-services</string>
              <string>magnetometer</string>
      </array>
      

      These are Geolocation settings I use:

      Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
      Titanium.Geolocation.activityType = Titanium.Geolocation.ACTIVITYTYPE_FITNESS;
      Titanium.Geolocation.distanceFilter = 7;

      And the code to register the background service:

      Bar.java

      var service = Ti.App.iOS.registerBackgroundService({
      	url : 'backgroundservice_tracker.js'
      });
      

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain (Inactive)
              Reporter:
              steffanb Steffan Bruin
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration