Skip to content

Commit a73b943

Browse files
committed
Update main.js
1 parent 6392992 commit a73b943

File tree

1 file changed

+5
-56
lines changed

1 file changed

+5
-56
lines changed

demo/main.js

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,13 @@ Gleap.setApiUrl("http://0.0.0.0:9000");
55

66
Gleap.setLanguage("de");
77

8-
Gleap.initialize("__");
9-
Gleap.open();
10-
//Gleap.setEnvironment("dev");
8+
Gleap.initialize("XNWIMPYahK8tJcJCp7RrqtoxZo1MMV7n");
119

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

16-
Gleap.playSound(false);
17-
18-
Gleap.on("initialized", (data) => {
19-
console.log("initialized", data);
20-
});
21-
22-
Gleap.attachCustomData({
23-
mission: "Unicorn",
24-
type: "Demo App",
25-
nestedData: {
26-
possible: true,
27-
name: "Mission: Impossible - Ghost Protocol",
28-
},
29-
});
30-
31-
Gleap.log("Test log");
32-
Gleap.log("Test log info", "INFO");
33-
Gleap.log("Test log warn", "WARNING");
34-
Gleap.log("Test log err", "ERROR");
35-
36-
Gleap.trackEvent("Master Event");
37-
38-
Gleap.on("unregister-pushmessage-group", (data) => {
39-
console.log("unreg", data);
40-
});
41-
42-
Gleap.on("register-pushmessage-group", (data) => {
43-
console.log("reg", data);
44-
});
45-
46-
// Register custom action.
47-
Gleap.registerCustomAction((customAction) => {
48-
console.log("Custom action called:");
49-
console.log(customAction);
50-
});
51-
52-
// Network logs test.
53-
setTimeout(() => {
54-
console.log("Loading place infos");
55-
56-
var xmlhttp = new XMLHttpRequest();
57-
var url = "https://jsonplaceholder.typicode.com/todos/1";
58-
xmlhttp.onreadystatechange = function () {
59-
if (this.readyState == 4 && this.status == 200) {
60-
var myArr = JSON.parse(this.responseText);
61-
console.log(myArr);
62-
}
63-
};
64-
xmlhttp.open("GET", url, true);
65-
xmlhttp.setRequestHeader("asdfasdf1", "wertwertwert1");
66-
xmlhttp.setRequestHeader("asdfasdf2", "wertwertwert2");
67-
xmlhttp.send();
68-
}, 5000);
14+
Gleap.identify("12345", {
15+
name: "John Doe",
16+
email: "lukas@gleap.io"
17+
});

0 commit comments

Comments
 (0)