Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17072] iOS: Send ti.background event while the application is in the background

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-06-04T16:59:01.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.3.0
ComponentsiOS
Labelsn/a
ReporterNeeraj Gupta
AssigneeSabil Rahim
Created2014-06-04T16:57:50.000+0000
Updated2014-06-13T21:47:31.000+0000

Description

Native SDK currently sends a ti.background event when the application comes to the foreground again or restarted. This affects the number of active sessions on the dashboard as the server times out these sessions after an hour. We can reduce the timeout but that reduces the time window instead of eliminating it completely. iOS7 provides a nice background feature that allows an application to make network calls when an application is in the background. We should use this feature to send the ti.background event when the session timeout period expires (currently 30 seconds). Set a 30 second timer (or whatever duration user has specified) and send the events once this timer fires. Remove this timer if the application is foregrounded before the expiry of this timeout. Please note that Android already implements this feature so this ticket brings iOS7 at par with Android.

Comments

  1. Ingo Muschenetz 2014-06-04

    TIMOB PR https://github.com/appcelerator/titanium_mobile/pull/5761 https://github.com/appcelerator/titanium_mobile/pull/5760
  2. Samuel Dowse 2014-06-13

    Verified on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201406111952 Titanium SDK, build: 3.3.0.v20140613124912 Titanium CLI, build: 3.3.0-rc Alloy: 1.4.0-rc iOS Device: iPhone 5S (7.1.1) Background event is sent while the application is still backgrounded. Closing.

JSON Source