Skip to content

Instantly share code, notes, and snippets.

@devcem
Created February 20, 2023 11:48
Show Gist options
  • Save devcem/16e0ddb7dacaf2abbf06a8ec01656a60 to your computer and use it in GitHub Desktop.
Save devcem/16e0ddb7dacaf2abbf06a8ec01656a60 to your computer and use it in GitHub Desktop.
PokiSDK mobile event test, put it in init function
console.scrollIndex = 0;
console.info = function(){
var el = document.createElement('div');
el.style.position = 'absolute';
el.style.top = (console.scrollIndex * 25) + 'px';
el.style.left = '0';
el.style.height = '15px';
el.style.background = 'rgba(0,0,0,0.5)';
el.style.color = 'white';
el.style.zIndex = '999999';
el.style.fontSize = '12px';
el.style.padding = '5px';
el.style.lineHeight = '15px';
var text = '';
for(var i = 0; i < arguments.length; i++){
text += arguments[i] + ' ';
}
if(text.search('POKI_TRACKER') > -1){
var eventName = text.split("'");
eventName = eventName[1].split("'");
var eventTime = new Date();
var eventTimeStr = eventTime.getMinutes() + ':' + eventTime.getSeconds();
el.innerHTML = eventTimeStr + ' -> ' + eventName[0];
document.body.appendChild(el);
console.scrollIndex++;
}
};
PokiSDK.setLogging(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment