Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26535] Android: Fix analytics session events

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-11-19T22:33:23.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.0.0
ComponentsAndroid
Labelsn/a
ReporterGary Mathews
AssigneeGary Mathews
Created2018-11-08T22:16:24.000+0000
Updated2018-11-26T16:57:59.000+0000

Description

- ti.foreground and ti.background events are being sent on every Activity onPause and onResume. This means every new window is classed as a new session, which is incorrect. - The events need to be tied to the application lifecycle and not each activity lifecycle *TEST CASE*
const win = Ti.UI.createWindow({ backgroundColor: 'blue' }),
      btn = Ti.UI.createButton({ title: 'OPEN' });

btn.addEventListener('click', () => {
    // this should not create a new session (not send ti.foreground)
    Ti.UI.createWindow({ backgroundColor: 'red' }).open();
});

win.add(btn);
win.open();

Comments

  1. Gary Mathews 2018-11-08

    master: https://github.com/appcelerator/titanium_mobile/pull/10449
  2. Samir Mohammed 2018-11-26

    *Closing ticket* Verified fix in SDK version 8.0.0.v20181121114345. ti.foreground and ti.background events are no longer being sent when opening and closing a new ticket. Tested using the test case above in the description. *Test Environment*
       APPC Studio: 5.1.1.201809051655
       Nexus 6P 6.0 (Sim)
       APPC CLI: 7.0.7
       Operating System Name: Mac OS Mojave
       Operating System Version: 10.14.1
       Node.js Version: 8.9.1
       Xcode 10.1
       

JSON Source