[TIMOB-14060] Parity: Backgrounding the app on Android does not send ti.end event
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-03T22:32:50.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.1.1, Release 3.2.0 |
Components | Android |
Labels | analytics, qe-3.1.1, qe-closed-3.1.1, qe-testadded |
Reporter | Mukesh Gadiya |
Assignee | Ping Wang |
Created | 2013-05-31T02:38:01.000+0000 |
Updated | 2014-03-13T00:21:05.000+0000 |
Description
1. In iOS, when app is closed/backgrounded and then brought back to foreground, sends ti.end and ti.start events indicating 1st session end and 2nd session begin respectively.
For example:
Event INFO :[{"id":"5225C0FF-D387-440C-9DA2-93737A3D2387","mid":"12DA5FD3-F582-4AF6-9E21-FB14AA8F102F","rdu":null,"type":"ti.foreground","aguid":"d8504b70-8106-4423-b35a-128a56fb30db","event":"ti.foreground","seq":11,"ver":"2","deploytype":"test","sid":"51AAB984-DBB2-4502-9ECE-6C2474380A7A","ts":"2013-05-31T01:11:06.038+0000","data":{"tz":-420,"os":"iphone","nettype":"WIFI","deploytype":"test","app_version":"1.0","osver":"5.0.1","version":"3.1.1","platform":"iphone","model":"iPhone4,1"}},{"id":"AAF8B7B7-E312-4E55-A942-2F0CE89AC6BF","mid":"12DA5FD3-F582-4AF6-9E21-FB14AA8F102F","rdu":null,"type":"ti.background","aguid":"d8504b70-8106-4423-b35a-128a56fb30db","event":"ti.background","seq":12,"ver":"2","deploytype":"test","sid":"51AAB984-DBB2-4502-9ECE-6C2474380A7A","ts":"2013-05-31T01:11:06.785+0000","data":null}]
2. On Android, backgrounding the app - either by pressing home button or by killing the the app from settings->app->force stop - does not send ti.end event to analytics. It is only sent when back button is pressed to get out of the app
From end user's perspective, getting out of the app is equivalent to ending the session in the app, so it makes sense to send ti.end event just like it is done on iOS.
Attachments
Relevant info: http://code.google.com/p/android/issues/detail?id=2373 (Activity stack behaves incorrectly during the first run of an app when started from Eclipse)
Android Activity Lifecycle and where Titanium analytics fits in: !activity_lifecycle.png!
PR: https://github.com/appcelerator/titanium_mobile/pull/4345
3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4346
Testing various cases.
Appcelerator Studio, build: 3.1.1.201306131423 3.1.1.v20130613185544 Device: Nexus7 Android version 4.2
Background and arrow back result in ti.end being sent Closing.