Skip to content

Instantly share code, notes, and snippets.

@srahim

srahim/app.js Secret

Created June 21, 2014 00:29
Show Gist options
  • Save srahim/dee140019b4baa735aff to your computer and use it in GitHub Desktop.
Save srahim/dee140019b4baa735aff to your computer and use it in GitHub Desktop.
Addition Regression Test for FeatureTest old behavior
var window = Ti.UI.createWindow({
backgroundColor: 'white',
layout: 'vertical'
});
var jsonString = {"key1":"value1","Key2":"value2"};
var b1 = Titanium.UI.createButton({
title: 'Send Feature Event string:',
top: 10,
width: Ti.UI.SIZE,
height: 50
});
b1.addEventListener('click',function(e)
{
Ti.API.info("Sending Feature Event");
Ti.Analytics.featureEvent('featureEvent', 'featureEvent.testButton');
});
var window = Ti.UI.createWindow({
backgroundColor: 'white',
layout: 'vertical'
});
var b2 = Titanium.UI.createButton({
title: 'Send Feature Event Jsonstring:',
top: 10,
width: Ti.UI.SIZE,
height: 50
});
b2.addEventListener('click',function(e)
{
Ti.API.info("Sending Feature Event Jsonstring:");
Ti.Analytics.featureEvent('featureEvent', JSON.stringify(jsonString));
});
var window = Ti.UI.createWindow({
backgroundColor: 'white',
layout: 'vertical'
});
var b5 = Titanium.UI.createButton({
title: 'Send Feature Event JSON:',
top: 10,
width: Ti.UI.SIZE,
height: 50
});
b5.addEventListener('click',function(e)
{
Ti.API.info("Sending Feature Event");
Ti.Analytics.featureEvent('featureEvent', jsonString);
});
var b3 = Titanium.UI.createButton({
title: 'Send Feature Event OBJECT:',
top: 10,
width: Ti.UI.SIZE,
height: 50
});
b3.addEventListener('click',function(e)
{
Ti.API.info("Sending Feature Event");
Ti.Analytics.featureEvent('featureEvent', b1);
});
var b4 = Titanium.UI.createButton({
title: 'Check Last Event',
top: 10,
width: Ti.UI.SIZE,
height: 50
});
b4.addEventListener('click',function(e)
{
Ti.API.info("Last Event ? " + Ti.Analytics.lastEvent);
alert(Ti.Analytics.lastEvent);
});
window.add(b1);
window.add(b2);
window.add(b3);
window.add(b5);
window.add(b4);
window.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment