Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1557] Geolocation background refresh stops

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-09-29T04:57:26.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsbackground, backgroundservice, geolocation, gps, ios, ios8, location, services
ReporterSteffan Bruin
AssigneeShak Hossain
Created2015-03-11T09:29:32.000+0000
Updated2016-03-08T07:38:01.000+0000

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:
var service = Ti.App.iOS.registerBackgroundService({
	url : 'backgroundservice_tracker.js'
});

Attachments

FileDateSize
backgroundservice_tracker.js2015-03-11T09:29:32.000+00007186

Comments

  1. Motiur Rahman 2015-09-07

    Hello, We tested the issue you reported. But we did not reproduce this issue with the latest environment. So we recommend you upgrade studio and SDK to the latest build then let us know if you get the similar behavior again. *Testing Environment:* Command-Line Interface, version 4.1.2, Ti SDK: 4.1.0.GA, iOS Device: iPod 5G(v8.4.1), Alloy: 1.7.6, Studio Version: 4.1.1 Thanks.

JSON Source