Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Jul 10, 2023
1 parent 6392992 commit a73b943
Showing 1 changed file with 5 additions and 56 deletions.
61 changes: 5 additions & 56 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,13 @@ Gleap.setApiUrl("http://0.0.0.0:9000");

Gleap.setLanguage("de");

Gleap.initialize("__");
Gleap.open();
//Gleap.setEnvironment("dev");
Gleap.initialize("XNWIMPYahK8tJcJCp7RrqtoxZo1MMV7n");

/*Gleap.setUrlHandler((url, newTab) => {
alert("URL: " + url + " newTab: " + newTab);
});*/

Gleap.playSound(false);

Gleap.on("initialized", (data) => {
console.log("initialized", data);
});

Gleap.attachCustomData({
mission: "Unicorn",
type: "Demo App",
nestedData: {
possible: true,
name: "Mission: Impossible - Ghost Protocol",
},
});

Gleap.log("Test log");
Gleap.log("Test log info", "INFO");
Gleap.log("Test log warn", "WARNING");
Gleap.log("Test log err", "ERROR");

Gleap.trackEvent("Master Event");

Gleap.on("unregister-pushmessage-group", (data) => {
console.log("unreg", data);
});

Gleap.on("register-pushmessage-group", (data) => {
console.log("reg", data);
});

// Register custom action.
Gleap.registerCustomAction((customAction) => {
console.log("Custom action called:");
console.log(customAction);
});

// Network logs test.
setTimeout(() => {
console.log("Loading place infos");

var xmlhttp = new XMLHttpRequest();
var url = "https://jsonplaceholder.typicode.com/todos/1";
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var myArr = JSON.parse(this.responseText);
console.log(myArr);
}
};
xmlhttp.open("GET", url, true);
xmlhttp.setRequestHeader("asdfasdf1", "wertwertwert1");
xmlhttp.setRequestHeader("asdfasdf2", "wertwertwert2");
xmlhttp.send();
}, 5000);
Gleap.identify("12345", {
name: "John Doe",
email: "[email protected]"
});

0 comments on commit a73b943

Please sign in to comment.