# News: Articles for #LIFF

LIFF v2.1.14, v2.2.1, v2.3.2 released

LIFF v2.1.14, v2.2.1, v2.3.2 were released. The changes are as follows:

# Fixed error in which the URL fragment entered in the LIFF endpoint URL was not correctly handled by liff.permanentLink.createUrl()


Affected version

  • LIFF v2.3.2

Changes

When the LIFF endpoint URL contained a URL fragment (#URL-fragment), despite the Methods for converting additional information in the LIFF URL being set to Replace (Backward compatibility mode), the URL fragment was included in the permanent link returned after executing liff.permanentLink.createUrl().

Conditions under which this problem occurs
  • A URL fragment is included in the LIFF endpoint URL
  • Methods for converting additional information in the LIFF URL is set to Replace (Backward compatibility mode)

For example, when the Endpoint URL is set to https://example.com/path#section and liff.permanentLink.createUrl() is executed, https://liff.line.me/{liffId}/path?liff.state=#section would be returned as the permanent link. In LIFF v.2.3.2, the bug is fixed so that https://liff.line.me/{liffId} would be correctly returned.

# Fixed error in which the query parameter entered in the LIFF endpoint URL was not correctly handled by liff.permanentLink.createUrl()


Affected version

  • LIFF v2.3.2

Changes

When the LIFF endpoint URL contained a query parameter (?key=value), the query parameter would infinitely multiply in the permanent link returned after executing liff.permanentLink.createUrl().

Conditions under which this problem occurs
  • The query parameter in the LIFF endpoint URL matches the query parameter in the LIFF URL when executing liff.permanentLink.createUrl().
  • Methods for converting additional information in the LIFF URL is set to Concatenate

For example, when the Endpoint URL is set to https://example.com/path1/?q1=v1&q2=v2 and liff.permanentLink.createUrl() is executed in https://liff.line.me/{liffid}/?q1=v1&q2=v2, a permanent link with the query parameter infinitely multiplied such as https://liff.line.me/{liffid}/?q1=v1&q1=v1&q2=v2&q2=v2 would be returned.

In LIFF v.2.3.2, the bug is fixed so that https://liff.line.me/{liffid}/?q1=v1&q2=v2 would be correctly returned.

# Fixed error in which the path entered in the LIFF Endpoint URL was not correctly handled by liff.permanentLink.createUrl()


Affected versions

  • LIFF v2.3.2

Changes

When path is included in the LIFF endpoint URL and a slash (/) is used at the end of the path, the permanent link obtained by executing liff.permanentLink.createUrl() would redirect you to URL without the ending slash as shown below.

Conditions under which this problem occurs
  • Path (/path/) is included in the LIFF endpoint URL, and a slash (/) is used at the end of the path
  • Query parameter (?key=value) or URL fragment (#URL-fragment) is included in the LIFF endpoint URL
  • Methods for converting additional information in the LIFF URL is set to Concatenate

For example, if Endpoint URL is set tohttps://example.com/path/?id=xxxxxxx, accessing a permanent link obtained by executing liff.permanentLink.createUrl() would redirect you to a URL without the ending slash, such as https://example.com/path?id=xxxxxxx.

In LIFF v2.3.2, the error has been fixed so that you are correctly redirected to https://example.com/path/?id=xxxxxxx.

LIFF v2.4.0 has already been fixed

As announced on August 31, 2020, this bug fix has already been reflected in LIFF v2.4.0.

# Fixed error in which fragment was not included in the secondary redirect URL


Affected version

  • LIFF v2.3.2

Changes

When a fragment was included in the LIFF endpoint URL or LIFF URL, regardless of settings based on Methods for converting additional information in the LIFF URL, the secondary redirect URL would not include a fragment. This error has been fixed.

For more details on the secondary redirect URL or how it is affected by settings based on Methods for converting additional information in the LIFF URL, see the LIFF document Operation from accessing LIFF URL to opening LIFF App.

# Fixed bug in which LIFF URLs were redirected to unintended URLs


Affected versions

  • LIFF v2.1.14
  • LIFF v2.2.1
  • LIFF v2.3.2

Changes

In the primary redirect destination URL, additional information specified in the LIFF URL (ex:path/?key=value) is included in the liff.state query parameter. When additional information was included in the liff.state query parameter, there was bug in which you were redirected to unintended URLs as shown below.

Conditions under which this problem occurs
  • There is no / at the beginning of the liff.state query parameter
  • Methods for converting additional information in the LIFF URL is set to Replace (Backward compatibility mode)

For example, when Endpoint URL is set to https://example.com, and the liff.state query parameter was path, the domain name and path would not be separated by /, resulting in being redirected to https://example.compath.
In LIFF v2.1.14, v2.2.1, v2.3.2, the bug has been fixed so that you are correctly redirected to https://example.com/path.

Regarding vulnerability caused by unintended redirects

There is a possibility that users are redirected to malicious websites due to this bug. If you are using a LIFF SDK version before v2.4.0, we recommend that you update it.

For more information on what happens when accessing LIFF URLs, see the LIFF document Operation from accessing LIFF URL to opening LIFF App.

LIFF v2.4.0 released

We have released LIFF v2.4.0. The changes in LIFF v2.4.0 are as follows:

# You can now use liff.closeWindow() before the LIFF app is initialized

You can now use the liff.closeWindow() method before the initialization of the LIFF app, even before the initialization of the LIFF app by liff.init() has finished.

Condition to execute the liff.closeWindow() method before initializing the LIFF app

To use the liff.closeWindow() method before the initialization of the LIFF app by liff.init() has finished, your LIFF SDK version must be v2.4.0 or later, and the user's LINE version must be 10.15.0 or later.

You can close the LIFF app with the liff.closeWindow() method if the LIFF app fails to initialize due to a network error, the user's LINE version, etc., as shown below.

liff
  .init({
    liffId: "123456-abcedfg" // Use own liffId
  })
  .then(() => {
    // Start to use liff's api
  })
  .catch((err) => {
    // Error happens during initialization
    console.log(err.code, err.message);
    liff.closeWindow();
  });

For more information, see liff.closeWindow() in the LIFF API Reference.

# You can now transition to another LIFF app without closing your current LIFF app

If you click the link to another LIFF app within a LIFF app whose screen is on Full display, you can display the other app while still having the LINE in-app browser open.
The LINE in-app browser doesn't close, so you can return to the original LIFF app with the return button from the LINE in-app browser.

Conditions to moving to another LIFF app without closing the current LIFF app
  • LIFF SDK v2.4.0 or later and LINE 10.16.0 or later
  • The original LIFF app screen is set to Full display
  • The LIFF app to which you are moving is correctly initialized by liff.init()

LIFF-apps-transition

For more information, see Opening a LIFF app from another LIFF app in the LIFF Document.

# The error that LIFF URLs are redirected to unexpected URLs was fixed

An additional information (path/?key=value) specified in a LIFF URL is included in the liff.state query parameter for the primary redirected URL. When the liff.state query parameter contains an additional information, it might be redirected to an unexpected secondary redirected URL as follows.

Conditions that cause this error
  • When the liff.state query parameter doesn't begin with /
  • When setting Methods for converting additional information in the LIFF URL to Replace (Backward compatibility mode)

For example, if Endpoint URL is set to https://example.com and the liff.state query parameter is assigned to path, it was redirected to https://example.compath because the domain name and the path were not separated by /.
In the LIFF v2.4.0, this error has been fixed so that the URL above is now correctly redirected to https://example.com/path.

For more information on behaviors when accessing a LIFF URL, see Behaviors from accessing the LIFF URL to opening the LIFF app.

# liff.permanentLink.createUrl() error was fixed

When information, such as query parameter (?key=value) or URL fragment (#URL-fragment), was included in the LIFF endpoint URL, on occasion, the additional information section was not accurately reflected in the permanent link when liff.permanentLink.createUrl() was executed. This error has been fixed.

# The error of fragment not being included in the secondary redirct URL was fixed

When a fragment was included in the LIFF endpoint URL or LIFF URL, regardless of settings based on Methods for converting additional information in the LIFF URL, the secondary redirect URL would not include a fragment. This error has been fixed.

For more details on the secondary redirect URL or how it is affected by settings based on Methods for converting additional information in the LIFF URL, see the LIFF document Operation from accessing LIFF URL to opening LIFF App.

LIFF v2.3.1 released

We've now released LIFF v2.3.1. The changes in LIFF v2.3.1 are as follows:

There are no feature updates in this release.

# Problems with the LIFF SDK npm package documentation were fixed

We fixed an issue with the npm official site documentation for the LIFF SDK npm package that was experimentally released.

# Installation and usage instructions of the LIFF SDK npm package were moved

We moved the installation and usage instructions of the LIFF SDK npm package from the npm official website to the LINE Developers site. For more information, see Use the npm package.

New feature has been added to the LIFF header

As announced on July 6, 2020, a new feature has been added to the LIFF header.

LIFF header design to be improved

# The LIFF app icon is no longer displayed

The icon in the upper left corner of the LIFF app is no longer displayed.

# The share button has been added

LIFF apps with the size of the LIFF app view set to Full include a share button in the header. When a user taps the share button, the following options appear:

Item Description
Share Shares the URL of the current page via a LINE message.
Refresh Reloads the current page.

Enable Module mode of the LIFF app in the LINE Developers Console to hide the share button. For more information, see Adding a LIFF app to your channel.

Operating environment

The share button will be available on LINE versions 10.12.0 or later for iOS and Android.

We will continue to improve the quality of the services we provide to our developers and we greatly appreciate your understanding.

Notice about service outage for LINE Front-end Framework (resolved)

We'd like to inform you about a service outage regarding LINE Front-end Framework. The issue has now been resolved but we sincerely apologize for any inconvenience that this may have caused.

# Date and time

Date: July 13, 2020
Time: 11:44–17:26 JST (GMT+9)

# Cause of the outage

Issue with our servers.

# Details

During the date and time stated above, there was an issue with our server that caused an error message to display when creating a new LIFF app. Although an error message was displayed, new LIFF apps were being created. We have already completed the recovery process.

We will continue to improve the quality of the services we provide to our developers and we greatly appreciate your understanding.

New feature will be added to the LIFF header

We plan to make changes to the LIFF header specifications after mid-July 2020.

LIFF header design to be improved

# The LIFF app icon will no longer be displayed

The icon in the upper left corner of the LIFF app will no longer be displayed.

# The share button will be added

LIFF apps with the size of the LIFF app view set to Full will include a share button in the header. When a user taps the share button, the following options will appear:

Items Description
Share Shares the URL of the current page via a LINE message.
Refresh Reloads the current page.

You can hide the share button by changing the settings of the LIFF app in the LINE Developers Console. This option will be added in the future.

Operating environment

The share button will be available on LINE versions 10.12.0 or later for iOS and Android.

# Scheduled date of specification change

The specification change is scheduled to take place in mid-July 2020 or later.

The content and date of the specification change is subject to change without notice. We will continue to improve the quality of the services we provide to our developers and we greatly appreciate your understanding.

LIFF SDK released as an npm package

Until now, to include the LIFF SDK in a LIFF app, it was necessary to Specify the CDN path.

Today, we released the LIFF SDK npm package on a trial basis. Now you can use npm and Yarn to install the LIFF SDK.

For more information on the LIFF SDK npm package, see https://www.npmjs.com/package/@line/liff.

The available LIFF SDK versions as an npm package is v2.3.0 or later. The features of future LIFF SDK versions will be announced in Release Notes in the LIFF Documentation.

npm package trial

The npm package is available on a trial basis. It may be changed or deleted in the future without notice.

LINE's APIs now support TLS 1.3

Added July 30, 2020

For access to the APIs from outside Japan, TLS 1.3 will be available after August 4, 2020. For more information, see the news on July 30, 2020, LINE's APIs will support HTTP/2.

LINE's APIs now support TLS 1.3.

# Domain names subject to the update

  • api.line.me
  • api-data.line.me
  • access.line.me

# SSL/TLS supported protocol versions

See this table for the differences before and after the update:

Protocol version Before update After update
TLS 1.3
TLS 1.2
TLS 1.1
TLS 1.0
SSL 3.0
SSL 2.0

# Impact

If you are using any of the above APIs, please confirm that your app can communicate using the updated supported protocol versions.

# Transition period

  • For access from Japan: TLS 1.3 is available after July 1, 2020.
  • For access from outside Japan: TLS 1.3 is available after August 4, 2020.

Support for TLS 1.0 and TLS 1.1 will be discontinued in the future. The discontinuation schedule is undecided. We will make an announcement as soon as it is decided.

We will continue to improve the quality of the services we provide to our developers and we greatly appreciate your understanding.

LIFF v2.3.0 released

We've now released LIFF v2.3.0. The changes in LIFF v2.3.0 are as follows:

# You can now use paths and query parameters in the LIFF endpoint URL

As announced before, you can now use paths (/path) and query parameters (?key=value) added to the LIFF endpoint URL in the LIFF tab of the LINE Developers Console.

Existing LIFF apps aren't effected until the setting is changed

It's necessary to change the setting in LINE Developers Console to use the new specs in existing LIFF apps. Existing LIFF apps aren't affected by the new spec until the setting is changed.

Methods for converting additional information in the LIFF URL

To use the new specs, set Methods for converting additional information in the LIFF URL to Concatenate.
Don't change the setting if your existing LIFF app doesn't support the new specs. If setting to Replace (Backward compatibility mode), the LIFF app isn't affected by the new specs.

For more information, see Opening a LIFF app in the LIFF documentation.

When executing the liff.permanentLink.createUrl() method, an exception is thrown if the current page URL doesn't start with the URL specified in Endpoint URL.

try {
    const myLink = liff.permanentLink.createUrl()
}
catch (err) {
    console.log(err.code + ':' + err.message);
}

Especially when setting Methods for converting additional information in the LIFF URL to Replace (Backward compatibility mode), the paths and query parameters (/2020campaign/?key=value) specified in Endpoint URL may not be included in the secondary redirect URL. In this case, you can't get a permanent link because the liff.permanentLink.createUrl() method meets the above conditions.

For more information, see liff.permanentLink.createUrl() in the LIFF v2 API reference.

# You can now get the send results of liff.shareTargetPicker()

As announced on April 21, 2020, you can now get the send results of liff.shareTargetPicker().

Before the spec change, the LIFF app was able to confirm whether the target picker was displayed, but not whether the message was sent after that.

After the change, the LIFF app is able to check whether the message has been sent, so you can change the behavior of the LIFF app depending on the user's situation.

Note
  • The return value of liff.shareTargetPicker() is changed due to this spec change.
  • This spec change doesn't affect users using LINE 10.3.0 - 10.10.0.

# Sample code for this spec change

We recommend you to handle the return value according to the LINE versions that users are using as shown below:

if (liff.isApiAvailable('shareTargetPicker')) {
  liff.shareTargetPicker([
    {
      'type': 'text',
      'text': 'Hello, World!'
    }
  ])
    .then(function (res) {
      if (res) {
        // succeeded in sending a message through TargetPicker
        console.log(`[${res.status}] Message sent!`)
      } else {
        const [majorVer, minorVer] = (liff.getLineVersion() || "").split('.');
        if (parseInt(majorVer) == 10 && parseInt(minorVer) < 11) {
          // LINE 10.3.0 - 10.10.0
          // Old LINE will access here regardless of user's action
          console.log('TargetPicker was opened at least. Whether succeeded to send message is unclear')
        } else {
          // LINE 10.11.0 -
          // sending message canceled
          console.log('TargetPicker was closed!')
        }
      }
    }).catch(function (error) {
      // something went wrong before sending a message
      console.log('something wrong happen')
    })
}

For more information, see liff.shareTargetPicker() in the LIFF v2 API reference.

# An error code returned by liff.sendMessages() added

Previously, if passing the wrong parameters to liff.sendMessages(), 400 was returned as the error code of LiffError. After the spec change, INVALID_ARGUMENT is returned instead.

As long as the processing isn't split by error codes, this spec change doesn't effect your LIFF app.

Before the spec change:

liff.sendMessages([
  {
    type: 'text',
    text: 'Hello, World!'
  }
])
  .then(() => {
    console.log('message sent');
  })
  .catch((err) => {
    // Returns "400" if invalid arguments are passed
    if (err.code === "400") {
      console.log("message format error!");
    }
  });

After the spec change:

liff.sendMessages([
  {
    type: 'text',
    text: 'Hello, World!'
  }
])
  .then(() => {
    console.log('message sent');
  })
  .catch((err) => {
    // Returns "INVALID_ARGUMENT" if invalid arguments are passed
    if (err.code === "INVALID_ARGUMENT") {
      console.log("message format error!");
    }
  });

For more information, see Error details in the LIFF v2 API reference.

LIFF v2.2.0 released: LIFF error codes added

The LiffError codes passed when Promise is rejected in the following methods have been made more detailed, making the cause of the problem easier to understand.

For more information, view the Error Response descriptions for these methods:

[Updated] Publish API documentation to get a permanent link

Added on July 15, 2020

There was a mistake in the API method name. We've corrected the mistake and apologize for any inconvenience caused by this error.

Incorrect:

liff.permanentLink.setExtraQueryParams()

Correct:

liff.permanentLink.setExtraQueryParam()

The LIFF SDK keeps a permanent link for the current page. We'll publish the documentation of the API that handles this permanent link.

  • liff.permanentLink.createUrl()
  • liff.permanentLink.setExtraQueryParam()

These APIs are already included in the latest LIFF SDK, so the LIFF SDK version doesn't change.

For more information on how to get a permanent link, see Get a permanent link for the current page in the LIFF documentation.

[Updated] You can soon add and use paths to your LIFF endpoint URL

Added on May 29, 2020

This specification change was scheduled to take place in the last week of May, 2020, but in consideration of the impact on existing LIFF applications, we will apply the following changes:

  • As announced on May 20, 2020, we will add the functionality to allow paths in endpoint URLs.
  • We plan to change specifications in such a way that existing LIFF apps will not be affected.
  • Specification change is scheduled for the second half of June 2020.

We apologize again for the inconvenience caused by the repeated specification changes.

Currently, developers are able to enter the path (/path), query parameters (?key=value), and URL fragments (#URL-fragment) in the URL in the LIFF tab of the LINE Developers Console, but only the domain name and query parameters of the URL string are used.

With the upcoming update, these improvements will be made to the LIFF endpoint URL:

  • The path (/path) can be used.
  • The URL fragments (#URL-fragment) can no longer be entered.

For example, if you're deploying the LIFF app on Heroku, you can enter https://{Heroku app name}.herokuapp.com/path/?key=value as the Endpoint URL in the Basic information section of the LINE Developers Console.

LIFF URL with paths appended in the LINE Developers Console

The URL scheme must use https.

Being able to use the paths you entered in the LINE Developers Console means less time is required to publish new web pages. For example, when publishing a page for a campaign, you can register the campaign page such as https://example.com/2020campaign directly in the endpoint URL.

Note

The endpoint URLs registered in the LINE Developers Console and the URL scheme for opening a LIFF app differ in the use of URL fragments. Be careful not to confuse them.

Endpoint URL:
https://example.com/2020campaign or https://example.com/2020campaign/?key=value
You can't add URL fragments.

URL scheme for opening a LIFF app:
https://liff.line.me/{liffId}/path_A/path_B/#URL-fragment
You can add URL fragments.

Learn more about Adding a LIFF app to your channel in the LIFF documentation.

We apologize for the confusion caused by the previous specification. We will continue to improve the quality of the services we provide to our developers and we greatly appreciate your understanding.

# Scheduled date of specification change

Second half of June, 2020

OGP tags are now available in the LIFF app

By setting an OGP tag for each page of your LIFF app, for example, you can display any title, description, or thumbnail image when sharing the URL of your LIFF app (https://liff.line.me/{liffId}) in the LINE talk room, and so on.

These are the OGP tags supported by LIFF. For more information on OGP tags, see The Open Graph protocol.

<html lang="ja" prefix="og: http://ogp.me/ns#">
<meta property="og:title" content="The title">
<meta property="og:type" content="`website`, `blog`, or `article`">
<meta property="og:description" content="A one to two sentence description">
<meta property="og:url" content="The URL">
<meta property="og:site_name" content="The name that represents the overall site">
<meta property="og:image" content="An image URL">
Note

When sharing the URL of the LIFF app in the format of line://app/{liffId} (deprecated), the OGP tag will be ignored.

LIFF Versioning policy and life cycle have been released

We released the LIFF Versioning policy to clarify the purpose of each version of LIFF. We've also released the life cycle of each MAJOR version so that developers can make appropriate preparations for the version upgrade of LIFF.

Use the latest version of LIFF SDK

As announced on October 16, 2019, LIFF v1 will be discontinued. After discontinuation, you cannot open LIFF apps that used LIFF v1.

For more information about the MAJOR version life cycle and the dates when LIFF v1 will be discontinued, see Life cycle of the LIFF SDK in the LIFF documentation.

# The LIFF Versioning policy

Beginning with LIFF v2.2.0, the version number of LIFF will follow the rules set by Semantic Versioning (SemVer).

SemVer defines this version format:

MAJOR.MINOR.PATCH

For example, in v1.2.3, 1 is the MAJOR version, 2 is the MINOR version, and 3 is the PATCH version.

The LIFF Versioning policy also explains the life cycle of the MAJOR version and provides an explanation for what each version (MAJOR, MINOR, PATCH) means for developers.

# LIFF SDK (sdk.js) update policy

Since the LIFF v2.1.13 release, we prepare these two types of CDN paths. When Integrating the LIFF SDK into LIFF app, specify the CDN path that suits your purpose.

CDN path Description
CDN edge path This is a method to specify only the MAJOR version. You can always use the new version of the LIFF SDK without updating your LIFF app.
e.g.: https://static.line-scdn.net/liff/edge/2/sdk.js
CDN fixed path This is a method to specify up to the PATCH version. You can continue to use the specified PATCH version as long as you don't update the LIFF app. It is not updated automatically and is not affected by the LIFF SDK update.
e.g.: https://static.line-scdn.net/liff/edge/versions/2.1.13/sdk.js

Example of specifying a CDN edge path:

<script charset="utf-8" src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
The CDN path to maintain backwards compatibility

In order to certify the behavior of the created LIFF app, we will continue to provide the LIFF SDK with the following CDN path. The LIFF SDK available with this CDN path is the same version as the LIFF SDK available with the CDN edge path.

CDN path for backwards compatibility:
https://static.line-scdn.net/liff/edge/2.1/sdk.js

Note

The CDN path to maintain backwards compatibility may be discontinued regardless of Life Cycle Schedule of the LIFF SDK. We recommend changing the CDN path specified in your LIFF app to the CDN edge path.

We will inform you as soon as the policy is decided.

Learn more about the LIFF Versioning policy in the LIFF documentation.

liff.getLineVersion() and liff.id added to LIFF v2

We added the liff.getLineVersion() method and the liff.id property to LIFF v2.

liff.getLineVersion() allows you to get the user's LINE version.

If a user opens the LIFF app using LINE's in-app browser, the LINE version of the user is returned as a string. If a user opens the LIFF app using an external browser, null is returned.

liff.id is the property that holds the LIFF app ID (String type) passed to liff.init().

Learn more about liff.getLineVersion() and liff.id in the LIFF v2 API reference.

Notice about the return value of liff.shareTargetPicker()

We will change the return value of liff.shareTargetPicker() on LIFF v2 in the future. If you are developing an app that uses the current specification, change the implementation.

Note

The specification for the return value of liff.shareTargetPicker() after the change isn't currently fixed.

# Summary

Before the specification change, the LIFF app could check whether the target picker could be displayed but couldn't check whether the message could be sent.

After the specification change, the LIFF app can check whether a message has been sent or not, so you can implement a change in LIFF app behavior to suit the user's situation.

# Before the specification change

# Sample

if (liff.isApiAvailable('shareTargetPicker')) {
  liff.shareTargetPicker([
    {
      type: "text",
      text: "Hello, World!"
    }
  ])
    .then(
      console.log("ShareTargetPicker was launched")
    ).catch(function(res) {
      console.log("Failed to launch ShareTargetPicker")
    })
}

# Syntax

liff.shareTargetPicker(messages)

# Return value

Returns a Promise object.

When the target picker is displayed, the Promise resolves.

If a problem occurs before the target picker is displayed, the Promise is rejected and a LiffError is passed. For more information on the LiffError object, see LIFF SDK errors.

Note
  • Situations after the target picker is displayed can't be detected, such as when the user doesn't select a destination in the displayed target picker.
  • In the callback function where the Promise has been resolved and rejected, the LIFF app won't work on some devices if the developer uses alert().

# After the specification change

# Sample

if (liff.isApiAvailable('shareTargetPicker')) {
  liff.shareTargetPicker([
    {
      type: "text",
      text: "Hello, World!"
    }
  ])
  .then(function(res) {
    if (res) {
      // succeeded to send message in TargetPicker
      console.log(`[${res.status}] Message [${this.msgType}] is sent!`)
    } else {
      // canceled to send message
      console.log('TargetPicker was closed!')
    }
  }).catch(function(error) {
    // something wrong happened before sending message properly
    console.log('something wrong happen')
  })
}

# Syntax

liff.shareTargetPicker(messages)

# Return value

Returns a Promise object.

If the message is sent correctly, the Promise is resolved and a success is passed.

If the user cancels and closes the target picker before sending the message, the Promise is resolved, but no success is passed.

If a problem occurs before the target picker is displayed, the Promise is rejected and a LiffError is passed. For more information on the LiffError object, see LIFF SDK errors.

We plan to change the error definition as the specification changes in the future.

Note

In the callback function where the Promise has been resolved and rejected, the LIFF app won't work on some devices if the developer uses alert().

# Scheduled date of specification change

TBD

liff.isApiAvailable() added to LIFF v2

We added the method liff.isApiAvailable() to LIFF v2. This method checks whether a specified API can be used in the environment where the LIFF app was launched.

Note

The number of APIs you can specify is limited. Currently, you can only specify liff.shareTargetPicker(). We'll notify you when more APIs can be checked with liff.isApiAvailable() in the future.

# Check if share target picker is available

By executing liff.isApiAvailable() before you execute liff.shareTargetPicker(), you can avoid the user getting an error message on their screen if the share target picker isn't available in their device environment.

if (liff.isApiAvailable('shareTargetPicker')) {
  liff.shareTargetPicker([
    {
      type: "text",
      text: "Hello, World!"
    }
  ])
    .then(
      alert("ShareTargetPicker was launched")
    ).catch(function(res) {
      alert("Failed to launch ShareTargetPicker")
    })
}

Learn more from liff.isApiAvailable() in the LIFF v2 API reference.

liff.shareTargetPicker() and liff.ready added to LIFF v2

We added liff.shareTargetPicker() and liff.ready to LIFF v2.

# liff.shareTargetPicker()

Execute the liff.shareTargetPicker() method to display the target picker (screen for selecting a group or friend) and send the message created by the developer to the selected target. This message appears to your group or friends as if you had sent it.

target picker

For more information, see Sending messages to a user's friend (share target picker) in the LIFF documentation.

Target picker operating environment

Target picker is supported by LINE 10.3.0 for iOS and Android.

# liff.ready

With liff.ready, you can get the Promise object that resolves when you run liff.init() for the first time after starting the LIFF app. If you use liff.ready, you can execute any process after the completion of liff.init().

For more information, see liff.ready in the LIFF v2 API reference.

Notice about LIFF v1 APIs and discontinuation schedule change

We announced that the end-of-life of LINE Front-end Framework (LIFF) server API was scheduled for March 31, 2020. Due to feedback received, we will continue to provide the API.

As for LIFF v1, we will announce the discontinuation schedule as soon as it is decided. In the meantime, we recommend that you migrate from v1 to v2 as soon as possible.

Feature Schedule before this update Schedule after this update
LIFF v1 Client API Scheduled for discontinuation Scheduled for discontinuation (This has not changed)
LIFF v1 Server API Scheduled for discontinuation on March 31, 2020 Support continues
LIFF v1 will still be discontinued

As announced on October 16, 2019, LIFF v1 will be discontinued. Use the latest version of LIFF.

Users can no longer add LIFF apps to Messaging API channels

As announced on November 11, 2019, due to a function enhancement with LIFF v2, users can no longer add LIFF apps to Messaging API channels.

To find out about restrictions on LIFF apps already added to the Messaging API channel, and how to transition to the LINE Login channel, see the above news article.

LIFF v1 Server API end-of-life on March 31, 2020

March 31, 2020 marks the end-of-life date for LINE Front-end Framework (LIFF) v1 Server API. On that date, these features will be removed:

Use the latest version of LIFF

As announced on October 16, 2019, LIFF v1 will be discontinued.

# Use LIFF v2

All discontinued Server API functions can be used in the LINE Developers Console. For more information on how to add a LIFF app to a channel, read this:

You can use other features with the same process.

LINE will continue to improve the quality of its services. Thank you for your understanding.

Update your code that uses the suspended LIFF SDK API

As announced on November 29, 2019, these APIs on LINE v9.19.0 and later for iOS were temporarily suspended due to technical issues.

  • liff.scanCode()
  • liff.bluetooth.*

Starting today, for end users using the LIFF app on LINE v9.19.0 and later for iOS, each API works as follows.

API Function
liff.scanCode() API is undefined
liff.bluetooth.* If the Bluetooth plug-in fails to initialize when calling liff.initPlugins(['bluetooth']), a FORBIDDEN error is returned.

If you use liff.scanCode(), we recommend that you also consider the above case and verify that the function exists.

Before modification:

liff.scanCode().then(result => {
  // result = { value: '' }
});

Modified:

if (liff.scanCode) {
	liff.scanCode().then(result => {
	  // result = { value: '' }
	});
}

For more information, see LIFF v2 API reference.

LINE will continue to improve the quality of its services. Thank you for your understanding.

Some LIFF functions suspended

Due to a technical issue, we've temporarily suspended the following LIFF functions. We'll let you know as soon as this situation changes.

  • liff.scanCode()
  • liff.bluetooth.*

# Impacted environments

Environment Version
LINE for iOS On version 9.19.0 and later, the functions listed above are temporarily unavailable.
LINE for Android Not affected for now, but more news will follow soon.

We apologize for the inconvenience and are working hard to solve the problem.

Users can no longer add LIFF apps to Messaging API channels

LIFF v2 is scheduled to be updated with LINE Login as the core channel. Additionally, an upcoming change will prevent users from adding LIFF apps to Messaging API channels entirely. We strongly recommend users to add LIFF apps to the LINE Login channel.

# Scheduled change date

Early February 2020

# Impact

Channel type Impact
LINE Login channel Not affected.
Messaging API channel After the specification change, LIFF apps cannot be added to the Messaging API channel. LIFF apps added to Messaging API channels at the time of specification change are still usable.
Do not add LIFF apps to the Messaging API channel

At this time, users can add LIFF apps to the Messaging API channel. However, we strongly advise against it due to the following restrictions:

  • The bot link feature can't be used.
  • LIFF feature expansion may not be supported.
  • The LIFF app may not be usable in the future.

LIFF apps added to the LINE Login channel have no restrictions and can use all LIFF v2 functions.

# Transition to the LINE Login channel

To continue using the LIFF app added to the Messaging API channel, re-add the LIFF app to the LINE Login channel. Once re-added, LINE Developers Console will issue a new LIFF app ID. As a result, please take note of the following:

  • If you're using LIFF v2, change the LIFF app ID specified in liff.init().
  • The LIFF URL used to launch LIFF (e.g.: line://app/1234567890-AbcdEfgh) will change.
Remove LIFF apps added to Messaging API channel

To avoid confusion, delete the LIFF app added to the Messaging API channel after adding to the LINE Login channel.

LIFF v2 released

LINE Front-end Framework (LIFF) v2 is a platform for web apps provided by LINE.

Use the latest version of LIFF

LIFF v1 will be deprecated.

# LIFF apps now run in external browsers

With LIFF v1, LIFF apps ran only in LINE's in-app browser. With LIFF v2, LIFF apps can also run in external browsers. This means you can develop LIFF apps using the same development environment as general web applications.

# Get user profile and email

Because compatibility with LINE Login v2.1 has improved, you can retrieve a user's ID and email address from the LINE platform. Your LIFF app can use this data to provide features related to user information and sending emails.

Furthermore, you can use LINE Login (web login flow) even when your LIFF app is running in an external browser. This means you can use the same information even when the LIFF app is running in an external browser.

# Read QR codes

You can start LINE's QR code reader and get the strings read by the user.

# Get LIFF app environment information

You can get the following details about the environment in which your LIFF app is running:

  • Operating system in which the LIFF app is running (iOS, Android, external browser)
  • Whether the LIFF app is running in the in-app browser (true, false)
  • Language settings

For more information, see LINE Front-end Framework.

Notice about system maintenance

We're performing system maintenance at the below time. We apologize for any inconvenience.

# Scheduled maintenance time

September 26, 2019 16:20-16:50 JST (+9 GMT)

The maintenance will only last a few seconds and will take place somewhere in this time window.

# Impact

Messaging API, LINE Login, and LIFF operations may result in errors. Specifically, the following events can occur:

  • Messaging API (https://api.line.me/v2/bot/*) returns an error with status code 500.
  • An error with status code 500 is returned when a user logs in with LINE Login or starts a LIFF app.

Improved consent screen in LINE Front-end Framework

We have improved the consent screen bundled with the LINE Front-end Framework (LIFF). The improvement is automatically applied to all LIFF apps. There's no need for additional development work.

New consent screen

As before this update, the user can choose to not allow the LIFF app to send messages to chats. But if they do so, unlike before, the consent screen will reappear the next time the user launches the LIFF app.

You can get access tokens through LIFF SDK

We added the liff.getAccessToken() method to the LIFF SDK.

Use the access token to interact with the Social API to access user profile data on the LINE Platform.

For more information, see Getting the user's access token.

Correction to documentation

There were errors in the news release and documentation for the new LIFF server API to update a LIFF app. We apologize for any inconvenience.

# News

【Incorrect】 The HTTP request to the API endpoint to update a LIFF app is changed from PUT to PATCH. Now you can partially update the properties of your LIFF apps.

【Correct】 The API endpoint for updating a LIFF app is changed. Now you can partially update the properties of your LIFF apps.

# API reference

【Incorrect】 PATCH https://api.line.me/liff/v1/apps/{liffId}

【Correct】 PUT https://api.line.me/liff/v1/apps/{liffId}

For more information, see Update LIFF app.

Renewed LIFF server API

Now you can set the following properties to your LIFF apps.

  • description property
  • features.ble property

The HTTP request to the API endpoint to update a LIFF app is changed from PUT to PATCH. Now you can partially update the properties of your LIFF apps.

For more information, see the following sections:

LIFF apps can now be added with the LINE Developers Console

Now you can add LIFF apps with the LINE Developers Console. As before, you can still add LIFF apps with the LIFF server API.

For more information, see Adding a LIFF app.

The maximum number of LIFF apps has been increased

Now you can add up to 30 LIFF apps for one channel. The previous maximum number was 10.

For more information, see Add LIFF app in the LIFF API reference documentation.

Notice about service outage for LINE Front-end Framework (resolved)

We'd like to inform you about a service outage regarding LINE Front-end Framework. The issue has now been resolved but we sincerely apologize for any inconvenience that this may have caused.

# Date and time of recovery

Date: June 21, 2018 around 17:30 JST (GMT+9)

# Cause of the outage

Issue with our servers.

# Details

When a LIFF app was added to a channel, the permission to retrieve the user's email address was revoked if it had been granted to the channel. Please check if the email permission has been revoked or not from the LINE Developers Console. Request the permission again if it has been revoked.

We will continue to improve the quality of the services we provide to our developers and we greatly appreciate your understanding.

LINE Front-end Framework released

LINE Front-end Framework (LIFF) is a platform for web apps that run within LINE.

When launching a web app (LIFF app) registered in LIFF in LINE, the LIFF app can get data from the LINE Platform such as the LINE user ID. The LIFF app can use such data to provide features that utilize user information and send messages on behalf of the user.

For more information, see LINE Front-end Framework.