Last active
October 18, 2019 04:51
-
-
Save tandevmode/8f0b2cf41d00844abbbfdbdd6a7aaa37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>My LIFF App</title> | |
</head> | |
<body> | |
<p id="scanCode"></p> | |
<p> | |
<button id="btnScanCode" onclick="scanCode();">Scan Code</button> | |
</p> | |
<script src="https://static.line-scdn.net/liff/edge/2.1/liff.js"></script> | |
<script> | |
function scanCode() { | |
liff.scanCode().then(result => { | |
const stringifiedResult = JSON.stringify(result); | |
alert(stringifiedResult); | |
document.getElementById("scanCode").textContent = stringifiedResult; | |
}); | |
} | |
liff.init({ liffId: "your-liff-id" }, () => {}, err => console.error(err.code, error.message)); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment