-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (102 loc) · 3.49 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html>
<head>
<link rel="manifest" href="/web-sdk-test/manifest.json">
<script type="text/javascript">
var clevertap = { event: [], profile: [], account: [] };
clevertap.account.push({ id: "W9R-486-4W5Z" });
(function () {
var wzrk = document.createElement("script");
wzrk.type = "text/javascript";
wzrk.async = true;
wzrk.src = "https://d2r1yp2w7bby2u.cloudfront.net/js/clevertap.min.js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(wzrk, s);
})();
</script>
</head>
<body style="background-color:#C0C0C0">
<script type="text/javascript">
function onClickOULSame() {
let value = document.getElementById("constantOUL").value;
clevertap.onUserLogin.push({
Site: {
// Email: `${Math.ceil(Math.random() * 100012)}@gmail.com`
Email: `${value}@gmail.com`
}
});
var data = `<div>WZRK_PR: ${localStorage["WZRK_PR"] ? decodeURIComponent(localStorage["WZRK_PR"]) : "Anonymous"}</div>`;
document.getElementById("profileDiv").innerHTML = data;
}
function onClickPPSame() {
let value = document.getElementById("constantPP").value;
clevertap.profile.push({
Site: {
Email: `${value}@gmail.com`
}
});
var data = `<div>WZRK_PR: ${localStorage["WZRK_PR"] ? decodeURIComponent(localStorage["WZRK_PR"]) : "Anonymous"}</div>`;
document.getElementById("profileDiv").innerHTML = data;
}
function getProfile() {
var customerType = clevertap.profile.getAttribute("Customer type");
console.log(customerType);
}
function onPopupClicked() {
clevertap.event.push('Order Created')
}
function onInboxClicked() {
clevertap.event.push('test-hi')
}
function addMultiValue() {
clevertap.addMultiValueForKey('userTVCount', '1')
}
function removeMultiValue() {
clevertap.removeMultiValueForKey('userTVCount', '1')
}
function enablePush() {
clevertap.notifications.push({
"titleText":"Would you like to receive Push Notifications?",
"bodyText":"We promise to only send you relevant content and give you updates on your transactions",
"okButtonText":"Ok",
"rejectButtonText":"Cancel",
"okButtonColor":"#F28046",
"askAgainTimeInSeconds":5,
"serviceWorkerPath": "./clevertap_sw.js"
});
}
</script>
<h1>Clevertap Tizen Test</h1>
<button onclick="onPopupClicked()">Web Popup</button>
<button onclick="onInboxClicked()">Web Inbox Event</button>
<button id='bell-selector'>Inbox</button>
<hr />
<br />
<p>On User Login</p>
<input type="text" id="constantOUL" class="textInput" /><input type="text" disabled value="@gmail.com"
class="textInput" />
<button onclick="onClickOULSame()" class="inputBtn">OUL</button>
<div id="profileDiv"></div>
<br />
<hr />
<p>Profile Push</p>
<input type="text" id="constantPP" class="textInput" /><input type="text" disabled value="@gmail.com"
class="textInput" />
<button onclick="onClickPPSame()" class="inputBtn">PP</button>
<hr />
<div id="userAgent"></div>
<button onclick="getgCookie()">Clevertap Id</button>
<div id="gcookie"></div>
<button onclick="addMultiValue()">Add Multi Value</button>
<button onclick="removeMultiValue()">Remove Multi Value</button>
<button onclick="enablePush()">Enable Push Notifications</button>
<script>
document.getElementById("userAgent").innerHTML = navigator.userAgent
</script>
<script>
function getgCookie() {
document.getElementById("gcookie").innerHTML = clevertap.getCleverTapID()
}
</script>
</body>
</html>