The LIFF v2 (LINE Front-end Framework) Code Snippets. It supports most of the APIs in LIFF v2 API reference. Type definitions for TypeScript are already included in the @line/liff package.
This extension contains a set of LIFF v2 code snippets that helps LIFF app developers write code faster.
liffsdk
: Put LIFF v2 SDK to the beginning of the BODY tag.
-
LIFF SDK properties
-
liff-ready
A property holding the Promise object that resolves when you run liff.init() for the first time after starting the LIFF app.
-
-
Initialization
-
liff-import
orimport-liff
Import @line/liff module
-
liff-init
Initializes a LIFF app.
-
-
Getting environment
-
liff-getContext
Gets the screen type (
1-on-1 chat
,group chat
,multi-person chat
, orexternal browser
) from which the LIFF app is launched. For1-on-1 chats
,group chats
, andmulti-person chats
, you also get a unique ID. -
liff-isInClient
Determines whether the LIFF app is running in a LIFF browser.
-
liff-isApiAvailable
Checks whether the specified API is available in the environment where you started the LIFF app.
-
liff-isApiAvailable-shareTargetPicker
liff.isApiAvailable('shareTargetPicker')
-
liff-isApiAvailable-multipleLiffTransition
liff.isApiAvailable('multipleLiffTransition')
-
-
Authentication
-
liff-permission-query
Verifies whether the user agrees to grant the specified permission.
-
-
Profile
-
liff-getProfile
Gets the current user's profile information.
-
liff-getFriendship
Gets the friendship status between a user and a LINE Official Account.
-
-
Window
-
liff-openWindow
Opens the specified URL in the LINE's in-app browser or external browser.
-
liff-closeWindow
Closes the LIFF app.
-
-
Message
-
liff-sendMessages
Sends messages on behalf of the user to the chat screen where the LIFF app is opened. This feature is only available in a LIFF app launched from a one-on-one chat room.
-
liff-liff-shareTargetPicker
Displays the target picker (screen for selecting a group or friend) and sends the message created by the developer to the selected target. This message appears to your group or friends as if you had sent it.
-
liff-msg-text
Represent a
TEXT
message object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-image
Represent an
IMAGE
message object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-location
Represent a
LOCATION
message object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-sticker
Represent a
STICKER
message object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-video
Represent a
VIDEO
message object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-audio
Represent an
AUDIO
message object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-flex
Represent a
Flex Message
object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-Template-Buttons
Represent a
Template Messages (Buttons)
object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-Template-Confirm
Represent a
Template Messages (Confirm)
object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-Template-Carousel
Represent a
Template Messages (Carousel)
object used inliff.sendMessages()
orliff.shareTargetPicker()
API. -
liff-msg-Template-ImageCarousel
Represent a
Template Messages (Image Carousel)
object used inliff.sendMessages()
orliff.shareTargetPicker()
API.
-
-
Camera
-
liff-scanCodeV2
Launch the 2D code reader and obtain string. To activate the 2D code reader, turn on Scan QR on the LINE Developers Console.
-
-
Permanent link
-
liff-permanentLink-createUrlBy
Get the permanent link of any page in the LIFF app.
-
- LINE Front-end Framework
- Developing a LIFF app
- LIFF v2 API reference
- LIFF Release notes
- LIFF Versioning policy
Enjoy!