[TIMOB-26535] Android: Fix analytics session events
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-19T22:33:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.0.0 |
Components | Android |
Labels | n/a |
Reporter | Gary Mathews |
Assignee | Gary Mathews |
Created | 2018-11-08T22:16:24.000+0000 |
Updated | 2018-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();
master: https://github.com/appcelerator/titanium_mobile/pull/10449
*Closing ticket* Verified fix in SDK version
8.0.0.v20181121114345
.ti.foreground
andti.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*