[TIMOB-16989] Analytics: Ti.Analytics return undefined
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-05-21T22:47:47.000+0000 |
| Affected Version/s | Release 3.3.0 |
| Fix Version/s | 2014 Sprint 10, 2014 Sprint 10 SDK, Release 3.3.0, Release 3.4.0 |
| Components | iOS |
| Labels | analytics, qe-3.3.0, qe-closed-3.3.0, qe-testadded, regression |
| Reporter | Olga Romero |
| Assignee | Sabil Rahim |
| Created | 2014-05-19T20:26:56.000+0000 |
| Updated | 2014-05-23T20:52:35.000+0000 |
Description
To reproduce:
run
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var label = Ti.UI.createLabel({
text:"who is who "+Ti.Analytics
});
win.add(label);
win.open();
var window = Ti.UI.createWindow({ backgroundColor: 'white', layout: 'vertical' }); var b1 = Titanium.UI.createButton({ title: 'Check Last Event ?', top: 10, width: Ti.UI.SIZE, height: 50 }); b1.addEventListener('click',function(e) { Ti.API.info("Checking lastEvent property"); Ti.API.info("Ti.Analytics.lastEvent :" + Ti.Analytics.lastEvent + "\n"); Ti.API.info("Ti.Analytics.getLastEvent() :" + Ti.Analytics.getLastEvent() + "\n"); alert(Ti.Analytics.getLastEvent()); }); window.add(b1); var b2 = Titanium.UI.createButton({ title: 'Send Nav Event', top: 10, width: Ti.UI.SIZE, height: 50 }); b2.addEventListener('click',function(e) { Ti.API.info("Sending Nav Event"); Ti.Analytics.navEvent('navEventOne', 'navEventTwo', 'navEvent.testButton'); }); window.add(b2); var b3 = Titanium.UI.createButton({ title: 'Send Feature Event', top: 10, width: Ti.UI.SIZE, height: 50 }); b3.addEventListener('click',function(e) { Ti.API.info("Sending Feature Event"); Ti.Analytics.featureEvent('featureEvent'); }); window.add(b3); window.open();https://github.com/appcelerator/titanium_mobile/pull/5721
https://github.com/appcelerator/titanium_mobile/pull/5724 3_3_X
Tested the above code and verified the fix using Appcelerator Studio, build: 3.3.0.201405161313 Titanium SDK, build: 3.3.0.v20140523120121 Node.JS Version: v0.10.13 NPM Version: 1.3.2 acs@1.0.14 alloy@1.4.0-alpha4 npm@1.3.2 titanium@3.3.0-alpha5 titanium-code-processor@1.1.1 Xcode 5.1.1 Device: iPhone 5C iOS 7.1
[INFO] : Checking lastEvent property [INFO] : Ti.Analytics.lastEvent :{"mid":"9537F35C-F507-41C8-9FB1-E6CA7B4559B3","id":"8DA9852C-4B3A-40A0-85A2-AE6CCFDB50DD","ts":"2014-05-23T20:49:40.733+0000","data":{"ostype":"32bit","app_id":"com.appc.test","oscpu":2,"tz":-420,"platform":"ios","nettype":"WIFI","os":"ios","app_name":"test","sdkver":"ti.3.3.0","osarch":"armv7s","deploytype":"test","model":"iPhone5,3","app_version":"1.0","osver":"7.1"},"ver":"3","sid":"97EA0A69-A549-4A24-9DB2-5224CACE5B13","event":"ti.foreground","aguid":"fa83c14f-1145-4b25-bf98-11e5569cdc9f","seq":4} [INFO] : Ti.Analytics.getLastEvent() :{"mid":"9537F35C-F507-41C8-9FB1-E6CA7B4559B3","id":"8DA9852C-4B3A-40A0-85A2-AE6CCFDB50DD","ts":"2014-05-23T20:49:40.733+0000","data":{"ostype":"32bit","app_id":"com.appc.test","oscpu":2,"tz":-420,"platform":"ios","nettype":"WIFI","os":"ios","app_name":"test","sdkver":"ti.3.3.0","osarch":"armv7s","deploytype":"test","model":"iPhone5,3","app_version":"1.0","osver":"7.1"},"ver":"3","sid":"97EA0A69-A549-4A24-9DB2-5224CACE5B13","event":"ti.foreground","aguid":"fa83c14f-1145-4b25-bf98-11e5569cdc9f","seq":4} [INFO] : Sending Nav Event [INFO] : Sending Feature Event