-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
110 lines (95 loc) · 3.45 KB
/
index.html
File metadata and controls
110 lines (95 loc) · 3.45 KB
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
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover">
<title>My LIFF app</title>
<link rel="stylesheet" href="css/style.css" media="all">
</head>
<body>
<p id="os"><b>OS:</b> </p>
<p id="language"><b>Language:</b> </p>
<p id="version"><b>Version:</b> </p>
<p id="isInClient"><b>isInClient:</b> </p>
<p id="accessToken"><b>AccessToken:</b> </p>
<img id="pictureUrl">
<p id="userId"><b>userId:</b> </p>
<p id="displayName"><b>displayName:</b> </p>
<p id="statusMessage"><b>statusMessage:</b> </p>
<p id="decodedIDToken"><b>email:</b> </p>
<p id="type"><b>type:</b> </p>
<p id="viewType"><b>viewType:</b> </p>
<p id="utouId"><b>utouId:</b> </p>
<p id="roomId"><b>roomId:</b> </p>
<p id="groupId"><b>groupId:</b> </p>
<p id="friendship"><b>isFriendship:</b> </p>
<p id="scanCode"><b>Code:</b> </p>
<p id="isLoggedIn"><b>isLoggedIn:</b> </p>
<p id="universalLink1"><b>Universal Link:</b> </p>
<p id="universalLink2"><b>Universal Link with Query params:</b> </p>
<p><a href="liff/path/?param=9">Link to Path</a></p>
<button id="btnMsg" onclick="sendMsg()">Send Message</button>
<button id="btnShare" onclick="shareMsg()">Share Target Picker</button>
<button onclick="openWindow()">Open Window</button>
<button id="btnScanCode" onclick="scanCode()">Scan Code</button>
<button id="btnLogOut" onclick="logOut()">Log Out</button>
<button id="btnClose" onclick="closed()">Close</button>
<script src="js/vconsole.min.js"></script>
<script>
var vConsole = new VConsole()
console.log("Hello World!")
</script>
<script src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
<script>
function createUniversalLink() {
}
async function shareMsg() {
}
function logOut() {
}
function closed() {
}
async function scanCode() {
}
function openWindow() {
}
async function getFriendship() {
}
async function sendMsg() {
}
function getContext() {
}
async function getUserProfile() {
const profile = await liff.getProfile()
document.getElementById("pictureUrl").src = profile.pictureUrl
document.getElementById("userId").append(profile.userId)
document.getElementById("statusMessage").append(profile.statusMessage)
document.getElementById("displayName").append(profile.displayName)
document.getElementById("decodedIDToken").append(liff.getDecodedIDToken().email)
}
function getEnvironment() {
document.getElementById("os").append(liff.getOS())
document.getElementById("language").append(liff.getLanguage())
document.getElementById("version").append(liff.getVersion())
document.getElementById("accessToken").append(liff.getAccessToken())
document.getElementById("isInClient").append(liff.isInClient())
if (liff.isInClient()) {
document.getElementById("btnLogOut").style.display = "none"
} else {
document.getElementById("btnMsg").style.display = "none"
document.getElementById("btnScanCode").style.display = "none"
document.getElementById("btnClose").style.display = "none"
}
}
async function main() {
await liff.init({ liffId: "1656973418-KM6vQmmr" })
getEnvironment()
getUserProfile()
// getContext()
// getFriendship()
// createUniversalLink()
}
main()
</script>
</body>
</html>