[AC-1557] Geolocation background refresh stops
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2015-09-29T04:57:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | background, backgroundservice, geolocation, gps, ios, ios8, location, services |
Reporter | Steffan Bruin |
Assignee | Shak Hossain |
Created | 2015-03-11T09:29:32.000+0000 |
Updated | 2016-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
File | Date | Size |
---|---|---|
backgroundservice_tracker.js | 2015-03-11T09:29:32.000+0000 | 7186 |
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.