Skip to content

Instantly share code, notes, and snippets.

@jirawatee
Last active April 27, 2021 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jirawatee/f5c00172099fe93130abd416d920e319 to your computer and use it in GitHub Desktop.
Save jirawatee/f5c00172099fe93130abd416d920e319 to your computer and use it in GitHub Desktop.
LIFF init
<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