Last active
April 27, 2021 05:11
-
-
Save jirawatee/f5c00172099fe93130abd416d920e319 to your computer and use it in GitHub Desktop.
LIFF init
This file contains hidden or 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
<script src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script> | |
<script> | |
async function main() { | |
// LIFF Initialize | |
await liff.init({ liffId: "LIFF-ID" }) | |
// Support external browser openning | |
if (liff.isLoggedIn()) { | |
// Get user profile from LINE | |
const profile = await liff.getProfile() | |
// Call getImageList() and also send profile object as an argument | |
getImageList(profile) | |
} else { | |
liff.login() | |
} | |
} | |
main() | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment